Closed justinlittman closed 6 years ago
This includes non-Stanford orgs, which don't have subtypes.
Existing query:
SELECT ?id ?type ?subtype ?name ?altLabel ?abbreviation ?parent WHERE { ?id a <http://xmlns.com/foaf/0.1/Organization> . ?id a ?type . ?id <http://www.w3.org/2004/02/skos/core#prefLabel>|<http://www.w3.org/2000/01/rdf-schema#label> ?name . FILTER ( ?id = <http://sul.stanford.edu/rialto/agents/orgs/038081b4b80720eed3e56e5743dda098> ) FILTER ( ?subtype NOT IN (<http://xmlns.com/foaf/0.1/Organization>, <http://xmlns.com/foaf/0.1/Agent>)) FILTER ( ?type = <http://xmlns.com/foaf/0.1/Organization>) OPTIONAL { ?id <http://www.w3.org/2004/02/skos/core#altLabel> ?altLabel . ?id <http://vivoweb.org/ontology/core#abbreviation> ?abbreviation . ?id <http://purl.obolibrary.org/obo/BFO_0000050> ?parent . } }
with subtype made optional:
SELECT ?id ?type ?subtype ?name ?altLabel ?abbreviation ?parent WHERE { ?id a <http://xmlns.com/foaf/0.1/Organization> . ?id a ?type . ?id <http://www.w3.org/2004/02/skos/core#prefLabel> ?name . FILTER ( ?id = <http://sul.stanford.edu/rialto/agents/orgs/038081b4b80720eed3e56e5743dda098> ) FILTER ( ! bound(?subtype) || ?subtype NOT IN (<http://xmlns.com/foaf/0.1/Organization>, <http://xmlns.com/foaf/0.1/Agent>)) FILTER ( ?type = <http://xmlns.com/foaf/0.1/Organization>) OPTIONAL { ?id a ?subtype . ?id <http://www.w3.org/2004/02/skos/core#altLabel> ?altLabel . ?id <http://vivoweb.org/ontology/core#abbreviation> ?abbreviation . ?id <http://purl.obolibrary.org/obo/BFO_0000050> ?parent . } }
returns:
This includes non-Stanford orgs, which don't have subtypes.
Existing query:
with subtype made optional:
returns: