17,525
edits
(→Project maintenance to-dos: ideas implemented) |
(→Export for Globi: default interactionTypeLabel "host of" if no other given) |
||
Line 91: | Line 91: | ||
SELECT DISTINCT ?argumentTypeName ?sourceTaxon ?sourceTaxonName ?sourceWdmap ?sourceTaxonId ? | #SELECT DISTINCT ?argumentTypeName ?sourceTaxon ?sourceTaxonName ?sourceWdmap ?sourceTaxonId ?interactionTypeName ?interactionTypeId ?targetTaxon ?targetTaxonName ?targetWdmap ?targetTaxonId ?sourceBodyPartName ?sourceBodyPartId ?referenceDoi ?referenceCitation WHERE { | ||
SELECT DISTINCT ?argumentTypeName ?sourceTaxonName ?sourceTaxonId ?interactionTypeName ?interactionTypeId ?targetTaxonName ?targetTaxonId ?sourceBodyPartName ?sourceBodyPartId ?referenceDoi ?referenceCitation WHERE { | |||
?sourceTaxon pps:P19 ?interaction. | ?sourceTaxon pps:P19 ?interaction. | ||
?interaction ppss:P19 ?targetTaxon. | ?interaction ppss:P19 ?targetTaxon. | ||
Line 102: | Line 103: | ||
OPTIONAL { | OPTIONAL { | ||
?interaction ppsq:P26 ?type. | ?interaction ppsq:P26 ?type. | ||
?type rdfs:label ?typeLabel. | |||
OPTIONAL { ?type ppt:P16 ?interactionTypeId. } | OPTIONAL { ?type ppt:P16 ?interactionTypeId. } | ||
} | } | ||
# if no interaction type is given, then default to "host of" | |||
BIND (EXISTS { ?interaction ppsq:P26 ?type. } AS ?existsType ) | |||
BIND (IF(?existsType, ?typeLabel, "host of") AS ?interactionTypeName) | |||
OPTIONAL { | OPTIONAL { | ||
?interaction prov:wasDerivedFrom ?refnode. | ?interaction prov:wasDerivedFrom ?refnode. | ||
Line 134: | Line 139: | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } | ||
} ORDER BY ?sourceTaxonName ?targetTaxonName | } ORDER BY ?sourceTaxonName ?targetTaxonName | ||
</sparql> | </sparql> |