|
I have a RDF file that contains resources with rdfs:label already assigned to them. What I am trying to achieve is to add additional skos:prefLabel for every rdfs:label instance in the document. I was trying to use CONSTRUCT to do it, but the rdfs:label get replaced by skos:prefLabel, which is wrong because I want to add the skos:prefLabel in addition to the existing rdfs:label. Hopefully someone can help on this. Thanks. I am using TopBraid Composer, And please bear with me I am noob in SPARQL and all the semantic web technologies. I was trying to make the below query work:
|
|
First, it seems that you have the concepts mixed up a little. It looks like you are trying to change types fo your labels. For one thing, rdfs:label is a property and not a class so placing it as object next to rdf:type (which a stands for) makes little sense. Other than that you don't reference the actual labelled resources in your WHERE graph pattern as I have expected to see. From your description I understand that you want to find all resources labelled with rdfs:label and add similar triples with skos:prefLabel instead. Provided that your file contains triples like
You should be using a CONSTRUCT like
and then combine the resulting graph with what you already have. 1
I don't use TBC, and I may be completeyl wrong, but if SKOS is imported will it infer that all skos:prefLabel s are rdfs:label s (as rdfs:label is a super property of skos:prefLabel - http://www.w3.org/2009/08/skos-reference/skos.html#prefLabel)? Also check out @scotthenniger 's response here - http://answers.semanticweb.com/questions/11115/rdfslabel-vs-skospreflabel-vs-dctitle @Tomasz, there is an extra ? before the rdfs:label in your query. @Holger Thanks, I have fixed that. |


CONSTRUCT is the way to go. Please show us the query you have and possibly we will be able to make it work right for you.
In addition, also let us know which tool you use to execute the CONSTRUCT query and modify the file.
I am using TopBraid Composer, And please bear with me I am noob in SPARQL and all the semantic web technologies.
I was trying to make the below query work:
CONSTRUCT { ?c a rdfs:label .
?c skos:prefLabel ?pl . } WHERE { ?c rdfs:subClassOf ?superclass . BIND(skos:prefLabel as ?pl) . }
I have submitted an answer but please post a sample of you file because I think I might be on a wrong track here.