SPARQL Query

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SPARQL Query

Abinaya
Hey all,

This is my code 

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

PREFIX owl: <http://www.w3.org/2002/07/owl#>

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

PREFIX uni: <http://www.semanticweb.org/admin/ontologies/2017/4/untitled-ontology-19#>

SELECT ?property ?subject ?prop ?object

WHERE {

 uni:Product ?property ?subject .

 OPTIONAL {?subject ?prop ?object }

}

This displays all properties including type, classes and all. I want it to display only object properties and data properties. What should I do?



_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: SPARQL Query

Rafael Gonçalves
Hi,

Which property do you want to be a datatype or object property? I’ll assume ?prop, and suggest to add the following to your basic graph pattern:

{ ?prop rdf:type owl:DatatypeProperty } UNION { ?prop rdf:type owl:ObjectProperty }

Cheers,
Rafael

On Jun 1, 2017, at 22:04, S.ABINAYA S.ABINAYA <[hidden email]> wrote:

Hey all,

This is my code 

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

PREFIX owl: <http://www.w3.org/2002/07/owl#>

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

PREFIX uni: <http://www.semanticweb.org/admin/ontologies/2017/4/untitled-ontology-19#>

SELECT ?property ?subject ?prop ?object

WHERE {

 uni:Product ?property ?subject .

 OPTIONAL {?subject ?prop ?object }

}

This displays all properties including type, classes and all. I want it to display only object properties and data properties. What should I do?


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: SPARQL Query

Abinaya
Hi

Thanks !
Assuming I just want the object properties to be displayed and there should be no repetition of lines, what should I do ?

On Fri, Jun 2, 2017 at 11:14 AM, Rafael Gonçalves <[hidden email]> wrote:
Hi,

Which property do you want to be a datatype or object property? I’ll assume ?prop, and suggest to add the following to your basic graph pattern:

{ ?prop rdf:type owl:DatatypeProperty } UNION { ?prop rdf:type owl:ObjectProperty }

Cheers,
Rafael

On Jun 1, 2017, at 22:04, S.ABINAYA S.ABINAYA <[hidden email]> wrote:

Hey all,

This is my code 

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

PREFIX owl: <http://www.w3.org/2002/07/owl#>

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

PREFIX uni: <http://www.semanticweb.org/admin/ontologies/2017/4/untitled-ontology-19#>

SELECT ?property ?subject ?prop ?object

WHERE {

 uni:Product ?property ?subject .

 OPTIONAL {?subject ?prop ?object }

}

This displays all properties including type, classes and all. I want it to display only object properties and data properties. What should I do?


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user



_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: SPARQL Query

Lorenz Buehmann
Hello,

the SPARQL documentation is your friend [1] ...

SELECT DISTINCT ?prop ...



Cheers,
Lorenz


[1] https://www.w3.org/TR/sparql11-query/#sparqlDistinct

Hi

Thanks !
Assuming I just want the object properties to be displayed and there should be no repetition of lines, what should I do ?

On Fri, Jun 2, 2017 at 11:14 AM, Rafael Gonçalves <[hidden email]> wrote:
Hi,

Which property do you want to be a datatype or object property? I’ll assume ?prop, and suggest to add the following to your basic graph pattern:

{ ?prop rdf:type owl:DatatypeProperty } UNION { ?prop rdf:type owl:ObjectProperty }

Cheers,
Rafael

On Jun 1, 2017, at 22:04, S.ABINAYA S.ABINAYA <[hidden email]> wrote:

Hey all,

This is my code 

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

PREFIX owl: <http://www.w3.org/2002/07/owl#>

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

PREFIX uni: <http://www.semanticweb.org/admin/ontologies/2017/4/untitled-ontology-19#>

SELECT ?property ?subject ?prop ?object

WHERE {

 uni:Product ?property ?subject .

 OPTIONAL {?subject ?prop ?object }

}

This displays all properties including type, classes and all. I want it to display only object properties and data properties. What should I do?


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user




_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user