Project:SPARQL/examples: Difference between revisions

Jump to navigation Jump to search
Line 54: Line 54:




===List all interactions, optionally the localization and interaction type===
===List all interactions, optionally the localization, interaction type, and references===
<sparql tryit="1">
<sparql tryit="1">
PREFIX pp: <https://ppsdb.wikibase.cloud/entity/>
PREFIX pp: <https://ppsdb.wikibase.cloud/entity/>
Line 61: Line 61:
PREFIX ppss: <https://ppsdb.wikibase.cloud/prop/statement/>
PREFIX ppss: <https://ppsdb.wikibase.cloud/prop/statement/>
PREFIX ppsq: <https://ppsdb.wikibase.cloud/prop/qualifier/>
PREFIX ppsq: <https://ppsdb.wikibase.cloud/prop/qualifier/>
PREFIX ppsr: <https://ppsdb.wikibase.cloud/prop/reference/>


SELECT DISTINCT ?host ?hostLabel ?typeLabel ?symbiontLabel ?localizationLabel WHERE {
SELECT DISTINCT ?host ?hostLabel ?typeLabel ?symbiontLabel ?localizationLabel ?doi ?statedin WHERE {
   ?host pps:P19 ?interaction.
   ?host pps:P19 ?interaction.
   ?interaction ppss:P19 ?symbiont.
   ?interaction ppss:P19 ?symbiont.
  OPTIONAL { ?interaction ppsq:P20 ?localization. }
  OPTIONAL { ?interaction ppsq:P26 ?type. }
   OPTIONAL {
   OPTIONAL {
    ?interaction ppsq:P20 ?localization.
    ?interaction prov:wasDerivedFrom ?refnode.
    OPTIONAL { ?refnode ppsr:P27 ?doi }
    OPTIONAL { ?refnode ppsr:P23 ?statedin }
   }
   }
  OPTIONAL {
    ?interaction ppsq:P26 ?type.
  }
   
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
}
</sparql>
</sparql>


==Maintenance queries==
==Maintenance queries==

Navigation menu