Query pronte all'uso su chem-pipeline. Per eseguirle scarica chem-pipeline.ttl e usalo con Apache Jena ARQ, Oxigraph, GraphDB, Stardog o qualunque triple store.
PREFIX chem: <https://ontology.siletto.it/chem-pipeline#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
Es. trovare quali pipeline producono alluminio o idrogeno verde.
SELECT ?pipeline ?label WHERE {
?pipeline a chem:Pipeline ;
chem:contains ?uo .
?uo chem:produces ?product .
?product rdfs:label "alluminio"@it .
?pipeline rdfs:label ?label . FILTER(LANG(?label) = "it")
}
Somma il contributo di ogni UnitOperation della filiera.
SELECT ?pipeline (SUM(?co2) AS ?totalCO2) WHERE {
?pipeline a chem:Pipeline ;
chem:contains ?uo .
?uo chem:co2Equivalent ?co2 .
} GROUP BY ?pipeline ORDER BY DESC(?totalCO2)
Sequenza ordinata di Unit Operation collegate. Es. cemento Portland.
SELECT ?from ?to WHERE {
?from chem:belongsTo chem:portlandCementPipeline ;
chem:feedsInto ?to .
} ORDER BY ?from
SELECT ?catalyst ?catLabel ?uo ?uoLabel WHERE {
?uo chem:usesCatalyst ?catalyst .
?catalyst rdfs:label ?catLabel . FILTER(LANG(?catLabel) = "it")
?uo rdfs:label ?uoLabel . FILTER(LANG(?uoLabel) = "it")
} ORDER BY ?catalyst
Apparecchiature che ricorrono in più filiere.
SELECT ?equipment ?label (COUNT(DISTINCT ?uo) AS ?used_in) WHERE {
?uo chem:requiresEquipment ?equipment .
?equipment rdfs:label ?label . FILTER(LANG(?label) = "it")
} GROUP BY ?equipment ?label HAVING (?used_in > 1) ORDER BY DESC(?used_in)
SELECT ?byproduct ?bLabel ?pipeline ?pLabel WHERE {
?pipeline a chem:Pipeline ;
chem:contains ?uo .
?uo chem:producesByproduct|chem:producesWaste ?byproduct .
?byproduct rdfs:label ?bLabel . FILTER(LANG(?bLabel) = "it")
?pipeline rdfs:label ?pLabel . FILTER(LANG(?pLabel) = "it")
} ORDER BY ?byproduct
SELECT ?uo ?label ?kWhPerKg WHERE {
?uo chem:requiresEnergy ?e ; rdfs:label ?label .
?e chem:energyForm "elettrica" ;
chem:specificEnergy ?kWhPerKg .
FILTER(LANG(?label) = "it")
} ORDER BY DESC(?kWhPerKg)
Solo le sostanze già linkate a ontologie esterne.
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX chebi: <http://purl.obolibrary.org/obo/CHEBI_>
SELECT ?substance ?label ?wikidata ?chebi WHERE {
?substance a chem:Substance ; rdfs:label ?label .
FILTER(LANG(?label) = "en")
OPTIONAL { ?substance owl:sameAs ?wikidata . FILTER(STRSTARTS(STR(?wikidata), STR(wd:))) }
OPTIONAL { ?substance owl:sameAs ?chebi . FILTER(STRSTARTS(STR(?chebi), STR(chebi:))) }
FILTER(BOUND(?wikidata) || BOUND(?chebi))
} ORDER BY ?label
Risale all'indietro la catena feedsInto partendo dall'UnitOperation che produce X.
SELECT ?rawMaterial ?label WHERE {
?uoEnd chem:produces chem:aluminium .
?uoStart (^chem:feedsInto)* ?uoEnd ;
chem:consumes ?rawMaterial .
FILTER NOT EXISTS { ?rawMaterial chem:isProducedBy ?_ }
OPTIONAL { ?rawMaterial rdfs:label ?label . FILTER(LANG(?label) = "it") }
}
Sfrutta il modello RoleAssignment (Sprint 1b): una stessa sostanza può avere ruoli diversi in pipeline diverse.
SELECT ?role ?pipeline ?pLabel WHERE {
chem:hydrogen chem:playsRole ?ra .
?ra chem:role ?role ;
chem:inPipeline ?pipeline .
?pipeline rdfs:label ?pLabel . FILTER(LANG(?pLabel) = "it")
} ORDER BY ?role
SELECT ?uo ?label ?Tmin_K ?Tmax_K ?P_atm WHERE {
?uo chem:operatesAt ?cond ; rdfs:label ?label .
?cond chem:temperatureMin ?Tmin_K ;
chem:temperatureMax ?Tmax_K .
OPTIONAL { ?cond chem:pressureMax ?Pmax . BIND(?Pmax/101325 AS ?P_atm) }
FILTER(LANG(?label) = "it")
} ORDER BY DESC(?Tmax_K)