Search code examples
sparqlowl

Sparql get property of


How can I get the value of a specific property with a sparql query.

I want to have this answer : http://micorr.ig.he-arc.ch/vocab#artefacts_alloy/3

I have this data :

<http://micorr.ig.he-arc.ch/vocab#artefacts_alloy/1>
    a                           vocab:artefacts_alloy , owl:NamedIndividual ;
    rdfs:label                  "Tin Bronze" ;
    vocab:artefacts_alloy_id    1 ;
    vocab:artefacts_alloy_name  "Tin Bronze" ;
    ont:isLinkedTo              <http://micorr.ig.he-arc.ch/vocab#artefacts_alloy/3> .

And my query is :

PREFIX owl:<http://www.w3.org/2002/07/owl#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX vocab:<http://micorr.ig.he-arc.ch/vocab#>
PREFIX ont: <http://purl.org/net/ns/ontology-annot#>

SELECT *
    FROM <http://localhost:8080/MiCorrDS/data/MiCorrGraph>
WHERE {
    ?alloy rdfs:label "Tin Bronze" .
    ?alloy ont:isLinkedTo ?linkedTo .
}

But no results are returned.

What is my mistake?

Thanks


Solution

  • The problem was that the ont: prefix refered to the wrong element.

    The correct one was :

    PREFIX ont: <http://www.co-ode.org/ontologies/ont.owl#>