Project:SPARQL/examples: Difference between revisions

No edit summary
Line 276: Line 276:
</sparql>
</sparql>


===List all classes===
===Graph of all classes===


<sparql tryit="1">
<sparql tryit="1">
#defaultView:Graph
PREFIX pp: <https://ppsdb.wikibase.cloud/entity/>
PREFIX ppt: <https://ppsdb.wikibase.cloud/prop/direct/>
PREFIX ppt: <https://ppsdb.wikibase.cloud/prop/direct/>
PREFIX pps: <https://ppsdb.wikibase.cloud/prop/>
PREFIX ppss: <https://ppsdb.wikibase.cloud/prop/statement/>
PREFIX ppsq: <https://ppsdb.wikibase.cloud/prop/qualifier/>


SELECT DISTINCT ?class ?classLabel  WHERE {
SELECT DISTINCT ?item ?itemLabel ?linkto ?linktoLabel WHERE {
   ?item ppt:P18 ?class
   ?item pps:P24 ?subclass.
  ?subclass ppss:P24/ppt:P24* pp:Q610.
  ?item ppt:P24 ?linkto
  OPTIONAL {
    ?item ppt:P2 ?wikidata
  }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
}