How to assign rdfs:isDefinedBy to all resources in the ontology

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

How to assign rdfs:isDefinedBy to all resources in the ontology

Daniel B.
Hi there! Quick question. How do I assert that all resources in my ontology
are defined in the ontology through the use of rdfs:isDefinedBy without
having to assert the property in each resource?

Thank you!

Daniel



-----
Daniel B.
--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Daniel B.
Reply | Threaded
Open this post in threaded view
|

Re: How to assign rdfs:isDefinedBy to all resources in the ontology

Michael DeBellis-2
Here is an idea: use SPARQL. I did a little test with a small ontology I'm just starting to build. I tried the following query in the Protege Snap SPARQL query tab:

CONSTRUCT {?subject rdfs:isDefinedBy "Foo"}
WHERE { ?subject rdfs:subClassOf   ?object}

When I did this the result was a list of triples where each class in my small ontology had its  rdfs:isDefinedBy annotation property set to "Foo".  I was actually surprised that it added this info to my ontology. I'm just getting to know SPARQL and I thought you needed to use INSERT {...} WHERE {...} and I don't think INSERT is supported in either Snap SPARQL or the SPARQL tab. But where as the CONSTRUCT just returned the triples in the SPARQL tab in the Snap SPARQL pane the CONSTRUCT added the new info to the ontology.  Of course rather than the string "Foo" you could add the IRI for your ontology or whatever you wanted to enter to show that the object is defined by the ontology. You could do similar queries to get all the properties and all the individuals and annotate them as well, just change the first part of the CONSTRUCT  expression so that it finds all properties and individuals. I think that should be straight forward but if you need help figuring it out let me know. Hope that helps. 

Michael


On Wed, Mar 18, 2020 at 3:28 AM Daniel B. <[hidden email]> wrote:
Hi there! Quick question. How do I assert that all resources in my ontology
are defined in the ontology through the use of rdfs:isDefinedBy without
having to assert the property in each resource?

Thank you!

Daniel



-----
Daniel B.
--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
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: How to assign rdfs:isDefinedBy to all resources in the ontology

marksem
In reply to this post by Daniel B.
Not sure it can be done without asserting them on each resource, but perhaps I'll learn something. :)

In order to do this we ended up writing a python/rdflib script that to read files and add the needed rdfs:isDefinedBy annotations based on the ontology URI in each file.



-----Original Message-----
From: protege-user <[hidden email]> On Behalf Of Daniel B.
Sent: Wednesday, March 18, 2020 6:29 AM
To: [hidden email]
Subject: [protege-user] How to assign rdfs:isDefinedBy to all resources in the ontology

Hi there! Quick question. How do I assert that all resources in my ontology are defined in the ontology through the use of rdfs:isDefinedBy without having to assert the property in each resource?

Thank you!

Daniel



-----
Daniel B.
--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
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: How to assign rdfs:isDefinedBy to all resources in the ontology

RazaSyed
Dear kindly share the python script 


Thanks 

On Thu, 19 Mar 2020, 22:33 Mark Wallace, <[hidden email]> wrote:
Not sure it can be done without asserting them on each resource, but perhaps I'll learn something. :)

In order to do this we ended up writing a python/rdflib script that to read files and add the needed rdfs:isDefinedBy annotations based on the ontology URI in each file.



-----Original Message-----
From: protege-user <[hidden email]> On Behalf Of Daniel B.
Sent: Wednesday, March 18, 2020 6:29 AM
To: [hidden email]
Subject: [protege-user] How to assign rdfs:isDefinedBy to all resources in the ontology

Hi there! Quick question. How do I assert that all resources in my ontology are defined in the ontology through the use of rdfs:isDefinedBy without having to assert the property in each resource?

Thank you!

Daniel



-----
Daniel B.
--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
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