sparql-examples

A set of SPARQL examples

View the Project on GitHub Adafede/sparql-examples

wd_maintenance_chemicals_inferred_statements

rq turtle/ttl

Statements inferred from another chemical property.

Use at


PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX prov: <http://www.w3.org/ns/prov#>
#title: Statements inferred from another chemical property.
SELECT ?item (COUNT(?statement) AS ?count) WHERE {
  VALUES ?inferred {
    # wd:Q123137214
    wd:Q113993940
    # wd:Q113907573
    # wd:Q123282952
  }
  ?item ?p ?s.
  ?s prov:wasDerivedFrom ?statement.
  ?statement pr:P887 ?inferred.
}
GROUP BY ?item ?p ?s ?inferred
HAVING (?count > 1 )

graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v7("?count")
  v2("?inferred")
  v3("?item"):::projected 
  v4("?p")
  v5("?s")
  v6("?statement"):::projected 
  f0[["?count > '1^^xsd:integer'"]]
  f0 --> v7
  bind1[/VALUES ?inferred/]
  bind1-->v2
  bind10(["wd:Q113993940"])
  bind10 --> bind1
  v3 -->v4--> v5
  v5 --"prov:wasDerivedFrom"-->  v6
  v6 --"pr:P887"-->  v2
  bind3[/"count(?statement)"/]
  v6 --o bind3
  bind3 --as--o v7