1

My query (excerpt) is roughly this.

CONSTRUCT {
?publication fb:type ?type;
fb:publicationType ?publicationType;
}
WHERE 
{
?publication a bibo:Document .
?publication vitro:mostSpecificType ?publicationType .
}

And it returns output similar to...

<rdf:Description rdf:about="https://abcd.fgh/individual/publication12345">
    <fb:publication>Example pub title</fb:publication>
    <fb:publicationType rdf:resource="http://purl.org/ontology/bibo/AcademicArticle"/>
</rdf:Description>

Perhaps a beginner-esque question, but how do I tweak the query such that the output is:

<rdf:Description rdf:about="https://abcd.fgh/individual/publication12345">
    <fb:publication>Example pub title</fb:publication>
    <fb:publicationType>Academic Article</fb:publicationType>
</rdf:Description>

Thanks

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58
Toolagio
  • 67
  • 9

1 Answers1

3

On the assumption that the bibo ontology is in the store you're querying, you can use its rdfs:label property in a property path:

CONSTRUCT {
  ?publication fb:type ?type;
    fb:publicationType ?publicationType;
} WHERE {
  ?publication a bibo:Document ;
    vitro:mostSpecificType/rdfs:label ?publicationType .
  FILTER (LANG(?publicationType) = "en")
}

The ?a vitro:mostSpecificType/rdfs:label ?b is shorthand for ?a vitro:mostSpecificType ?something. ?something rdfs:label ?b, without binding the intermediate term.