Datatype Properties in Instance Document Classified as Annotations

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

Datatype Properties in Instance Document Classified as Annotations

Nolan Nichols
Hi All,

When I load an RDF file into Protege all the properties other than rdf:type are assumed to be Annotation Properties, regardless of whether or not an ontology is loaded that defines a given property as an Object or Datatype Property. 

For example: 

niiri:software_id
    a prov:Agent, owl:NamedIndividual ; 
    rdfs:label "SPM" ;
    nidm:softwareVersion "SPM12b"^^xsd:string .


Is this the expected behavior? 

I've found that adding individuals to the bottom of the ontology document that defines the property types will correctly classify the properties used in the individuals; however, how do I go about keeping my Ontology and Individuals in separate documents and get them to correctly merge in Protege?

My apologies if this question has been answered before, I tried looking through the forum archives etc. and couldn't find a proper answer.

Cheers,

Nolan

--
Nolan Nichols
PhD Candidate
Integrated Brain Imaging Center
Biomedical and Health Informatics 
University of Washington

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

Re: Datatype Properties in Instance Document Classified as Annotations

Matthew Horridge-2
Administrator
Hi Nolan,

For RDF based formats, if the type of the property isn’t specified and can’t be deduced using some heuristics then it will be parsed an an annotation property.  Therefore the type needs to be specified somewhere in the imports closure.  If x and y aren’t typed then x rdf:type y will be parsed with x as an individual, and y as a class (if y isn’t in the reserved vocabulary).  For example, with properties it might not be clear as to what to do.  In your example below I can’t tell whether nidm:softwareVersion is a data property or an annotation property.  The OWL API, which Protege uses, takes the “safest” approach an assumes annotation properties.

So, you either need to declare the property types in your ontology document with the property assertions (as you say that you tried) - my personal point of view is that this is the best approach.  The alternative is to specify the types in an imported ontology.  I’d stick with the first approach though - it’s more robust.

Cheers,

Matthew



On 18 Jun 2014, at 07:13, Nolan Nichols <[hidden email]> wrote:

Hi All,

When I load an RDF file into Protege all the properties other than rdf:type are assumed to be Annotation Properties, regardless of whether or not an ontology is loaded that defines a given property as an Object or Datatype Property. 

For example: 

niiri:software_id
    a prov:Agent, owl:NamedIndividual ; 
    rdfs:label "SPM" ;
    nidm:softwareVersion "SPM12b"^^xsd:string .


Is this the expected behavior? 

I've found that adding individuals to the bottom of the ontology document that defines the property types will correctly classify the properties used in the individuals; however, how do I go about keeping my Ontology and Individuals in separate documents and get them to correctly merge in Protege?

My apologies if this question has been answered before, I tried looking through the forum archives etc. and couldn't find a proper answer.

Cheers,

Nolan

--
Nolan Nichols
PhD Candidate
Integrated Brain Imaging Center
Biomedical and Health Informatics 
University of Washington
_______________________________________________
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: Datatype Properties in Instance Document Classified as Annotations

Nolan Nichols
Thanks, Matthew.

The approach of adding the property definitions to the document of individuals does indeed work. I'll go that route moving forward.

Cheers,

Nolan
Reply | Threaded
Open this post in threaded view
|

Re: Datatype Properties in Instance Document Classified as Annotations

Alan Ruttenberg-2
I think this problem happens not infrequently. What about having some visual indicator when assumptions like this are made and the ontology is "corrected". A listing of what was done and pointer to a web page discussing the issues could be cool.  

Not that red danger symbol in the upper right corner though. Something a little more visually present but subtler - maybe an translucent overlay across the top of whatever tab with a "click to see more information", with the overlay disappearing after the next interaction with protege. 

-Alan

On Thursday, June 19, 2014, Nolan Nichols <[hidden email]> wrote:
Thanks, Matthew.

The approach of adding the property definitions to the document of
individuals does indeed work. I'll go that route moving forward.

Cheers,

Nolan



--
View this message in context: http://protege-project.136.n4.nabble.com/Datatype-Properties-in-Instance-Document-Classified-as-Annotations-tp4660742p4660748.html
Sent from the Protege User mailing list archive at Nabble.com.
_______________________________________________
protege-user mailing list
<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;protege-user@lists.stanford.edu&#39;)">protege-user@...
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: Datatype Properties in Instance Document Classified as Annotations

Matthew Horridge-2
Administrator
In reply to this post by Nolan Nichols
Hi Nolan,

Glad this worked out for you.

Cheers,

Matthew

On 18 Jun 2014, at 21:06, Nolan Nichols <[hidden email]> wrote:

> Thanks, Matthew.
>
> The approach of adding the property definitions to the document of
> individuals does indeed work. I'll go that route moving forward.
>
> Cheers,
>
> Nolan
>
>
>
> --
> View this message in context: http://protege-project.136.n4.nabble.com/Datatype-Properties-in-Instance-Document-Classified-as-Annotations-tp4660742p4660748.html
> Sent from the Protege User mailing list archive at Nabble.com.
> _______________________________________________
> 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: Datatype Properties in Instance Document Classified as Annotations

Matthew Horridge-2
Administrator
In reply to this post by Alan Ruttenberg-2
Hi Alan,

I think this problem happens not infrequently.

I’d say all too frequently.

What about having some visual indicator when assumptions like this are made and the ontology is "corrected". A listing of what was done and pointer to a web page discussing the issues could be cool.  

This is something that I’d really like to get sorted.  At the moment the OWL API doesn’t provide any decent hooks to obtain this information nicely.  However it looks like this functionality will be added though.  We had some discussions about it in the not too distant past.

Not that red danger symbol in the upper right corner though. Something a little more visually present but subtler - maybe an translucent overlay across the top of whatever tab with a "click to see more information", with the overlay disappearing after the next interaction with protege. 

How about something after loading (or importing) that could also be accessed later on via a menu?  The other idea that we had would be to pop up a dialog during the parse with the guesses listed and asking the user to make corrections where necessary.

Cheers,

Matthew


-Alan

On Thursday, June 19, 2014, Nolan Nichols <[hidden email]> wrote:
Thanks, Matthew.

The approach of adding the property definitions to the document of
individuals does indeed work. I'll go that route moving forward.

Cheers,

Nolan



--
View this message in context: http://protege-project.136.n4.nabble.com/Datatype-Properties-in-Instance-Document-Classified-as-Annotations-tp4660742p4660748.html
Sent from the Protege User mailing list archive at Nabble.com.
_______________________________________________
protege-user mailing list
<a href="javascript:;" onclick="_e(event, 'cvml', 'protege-user@lists.stanford.edu')">protege-user@...
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: Datatype Properties in Instance Document Classified as Annotations

Timothy Redmond

What about having some visual indicator when assumptions like this are made and the ontology is "corrected". A listing of what was done and pointer to a web page discussing the issues could be cool.  

This is something that I’d really like to get sorted.  At the moment the OWL API doesn’t provide any decent hooks to obtain this information nicely.  However it looks like this functionality will be added though.  We had some discussions about it in the not too distant past.

I think though that you can actually detect some of these situations because I wrote some code for this some time ago. 

It may be - I don't fully remember - that the OWL api does not add declarations if they are not present in the original RDF.  So if an RDF-based file is parsed and some of the declarations that should be present are missing, then this is enough to generate warnings and for a plugin to investigate and provide options.

-Timothy


On 06/19/2014 10:16 AM, Matthew Horridge wrote:
Hi Alan,

I think this problem happens not infrequently.

I’d say all too frequently.

What about having some visual indicator when assumptions like this are made and the ontology is "corrected". A listing of what was done and pointer to a web page discussing the issues could be cool.  

This is something that I’d really like to get sorted.  At the moment the OWL API doesn’t provide any decent hooks to obtain this information nicely.  However it looks like this functionality will be added though.  We had some discussions about it in the not too distant past.

Not that red danger symbol in the upper right corner though. Something a little more visually present but subtler - maybe an translucent overlay across the top of whatever tab with a "click to see more information", with the overlay disappearing after the next interaction with protege. 

How about something after loading (or importing) that could also be accessed later on via a menu?  The other idea that we had would be to pop up a dialog during the parse with the guesses listed and asking the user to make corrections where necessary.

Cheers,

Matthew


-Alan

On Thursday, June 19, 2014, Nolan Nichols <[hidden email]> wrote:
Thanks, Matthew.

The approach of adding the property definitions to the document of
individuals does indeed work. I'll go that route moving forward.

Cheers,

Nolan



--
View this message in context: http://protege-project.136.n4.nabble.com/Datatype-Properties-in-Instance-Document-Classified-as-Annotations-tp4660742p4660748.html
Sent from the Protege User mailing list archive at Nabble.com.
_______________________________________________
protege-user mailing list
<a moz-do-not-send="true" href="javascript:;" onclick="_e(event, 'cvml', 'protege-user@lists.stanford.edu')">protege-user@...
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


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

Re: Datatype Properties in Instance Document Classified as Annotations

Matthew Horridge-2
Administrator

On 19 Jun 2014, at 10:23, Timothy Redmond <[hidden email]> wrote:


What about having some visual indicator when assumptions like this are made and the ontology is "corrected". A listing of what was done and pointer to a web page discussing the issues could be cool.  

This is something that I’d really like to get sorted.  At the moment the OWL API doesn’t provide any decent hooks to obtain this information nicely.  However it looks like this functionality will be added though.  We had some discussions about it in the not too distant past.

I think though that you can actually detect some of these situations because I wrote some code for this some time ago. 

Oh, that is true.  I didn’t think of that.  I’ll add an item to the track as this would be an easy fix.


It may be - I don't fully remember - that the OWL api does not add declarations if they are not present in the original RDF.

Yes, I think that’s correct.

  So if an RDF-based file is parsed and some of the declarations that should be present are missing, then this is enough to generate warnings and for a plugin to investigate and provide options.

Yep.  Thanks for the sanity check!

Cheers,

Matthew


-Timothy


On 06/19/2014 10:16 AM, Matthew Horridge wrote:
Hi Alan,

I think this problem happens not infrequently.

I’d say all too frequently.

What about having some visual indicator when assumptions like this are made and the ontology is "corrected". A listing of what was done and pointer to a web page discussing the issues could be cool.  

This is something that I’d really like to get sorted.  At the moment the OWL API doesn’t provide any decent hooks to obtain this information nicely.  However it looks like this functionality will be added though.  We had some discussions about it in the not too distant past.

Not that red danger symbol in the upper right corner though. Something a little more visually present but subtler - maybe an translucent overlay across the top of whatever tab with a "click to see more information", with the overlay disappearing after the next interaction with protege. 

How about something after loading (or importing) that could also be accessed later on via a menu?  The other idea that we had would be to pop up a dialog during the parse with the guesses listed and asking the user to make corrections where necessary.

Cheers,

Matthew


-Alan

On Thursday, June 19, 2014, Nolan Nichols <[hidden email]> wrote:
Thanks, Matthew.

The approach of adding the property definitions to the document of
individuals does indeed work. I'll go that route moving forward.

Cheers,

Nolan



--
View this message in context: http://protege-project.136.n4.nabble.com/Datatype-Properties-in-Instance-Document-Classified-as-Annotations-tp4660742p4660748.html
Sent from the Protege User mailing list archive at Nabble.com.
_______________________________________________
protege-user mailing list
<a moz-do-not-send="true" href="javascript:;" onclick="_e(event, 'cvml', 'protege-user@lists.stanford.edu')">protege-user@...
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

_______________________________________________
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: Datatype Properties in Instance Document Classified as Annotations

Alan Ruttenberg-2
In reply to this post by Matthew Horridge-2



On Thu, Jun 19, 2014 at 1:16 PM, Matthew Horridge <[hidden email]> wrote:
Hi Alan,

I think this problem happens not infrequently.

I’d say all too frequently.
:) 

What about having some visual indicator when assumptions like this are made and the ontology is "corrected". A listing of what was done and pointer to a web page discussing the issues could be cool.  

This is something that I’d really like to get sorted.  At the moment the OWL API doesn’t provide any decent hooks to obtain this information nicely.  However it looks like this functionality will be added though.  We had some discussions about it in the not too distant past.

One way to detect it would be examine the triples directly looking for declarations for any of the annotation properties. If the OWLAPI doesn't give direct access to the read triples after the fact you can also read in the file using jena. Which reminds me. The reason you wouldn't want to do a second read is because of network download time, for the most part (maybe memory too). For the download, I'm wondering whether you would consider adding caching to portage. The idea would be to save all downloaded ontology documents. When you need load one, use a HTTP HEAD to see if there's an etag or or last changed date, and if so and the file hasn't changed (or if you are offline), just load the local copy.
 

Not that red danger symbol in the upper right corner though. Something a little more visually present but subtler - maybe an translucent overlay across the top of whatever tab with a "click to see more information", with the overlay disappearing after the next interaction with protege. 

How about something after loading (or importing) that could also be accessed later on via a menu?  The other idea that we had would be to pop up a dialog during the parse with the guesses listed and asking the user to make corrections where necessary.

They works. Offering to make the changes directly from the menu action would be helpful. For each of the properties without declaration offer a radio button to choose to add an object, data, or annotation property declaration. May too a buttons for: "they're all data/object/annotation properties".

-Alan 

Cheers,

Matthew


-Alan

On Thursday, June 19, 2014, Nolan Nichols <[hidden email]> wrote:
Thanks, Matthew.

The approach of adding the property definitions to the document of
individuals does indeed work. I'll go that route moving forward.

Cheers,

Nolan



--
View this message in context: http://protege-project.136.n4.nabble.com/Datatype-Properties-in-Instance-Document-Classified-as-Annotations-tp4660742p4660748.html
Sent from the Protege User mailing list archive at Nabble.com.
_______________________________________________
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



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

Re: Datatype Properties in Instance Document Classified as Annotations

Matthew Horridge-2
Administrator
Hi Alan,

What about having some visual indicator when assumptions like this are made and the ontology is "corrected". A listing of what was done and pointer to a web page discussing the issues could be cool.  

This is something that I’d really like to get sorted.  At the moment the OWL API doesn’t provide any decent hooks to obtain this information nicely.  However it looks like this functionality will be added though.  We had some discussions about it in the not too distant past.

One way to detect it would be examine the triples directly looking for declarations for any of the annotation properties.

Yes.  Tim pointed this out to me in another email as well.  We’ll look into this.

If the OWLAPI doesn't give direct access to the read triples after the fact you can also read in the file using jena.

It doesn’t give them to use after the fact, but it’s possible to deduce missing declarations based on the format and whether or not the declarations are contained in the ontology.  The declarations don’t get added on load if they are not present.

Which reminds me. The reason you wouldn't want to do a second read is because of network download time, for the most part (maybe memory too). For the download, I'm wondering whether you would consider adding caching to portage. The idea would be to save all downloaded ontology documents. When you need load one, use a HTTP HEAD to see if there's an etag or or last changed date, and if so and the file hasn't changed (or if you are offline), just load the local copy.

Good idea.  I’ve added an item to the issue tracker.


 

Not that red danger symbol in the upper right corner though. Something a little more visually present but subtler - maybe an translucent overlay across the top of whatever tab with a "click to see more information", with the overlay disappearing after the next interaction with protege. 

How about something after loading (or importing) that could also be accessed later on via a menu?  The other idea that we had would be to pop up a dialog during the parse with the guesses listed and asking the user to make corrections where necessary.

They works. Offering to make the changes directly from the menu action would be helpful. For each of the properties without declaration offer a radio button to choose to add an object, data, or annotation property declaration. May too a buttons for: "they're all data/object/annotation properties”.

Yes. I was thinking of something along those lines.  It might also be possible to remember settings for certain files and URLs as well. (With an option to clear of course).

Cheers,

Matthew



-Alan 

Cheers,

Matthew


-Alan

On Thursday, June 19, 2014, Nolan Nichols <[hidden email]> wrote:
Thanks, Matthew.

The approach of adding the property definitions to the document of
individuals does indeed work. I'll go that route moving forward.

Cheers,

Nolan



--
View this message in context: http://protege-project.136.n4.nabble.com/Datatype-Properties-in-Instance-Document-Classified-as-Annotations-tp4660742p4660748.html
Sent from the Protege User mailing list archive at Nabble.com.
_______________________________________________
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


_______________________________________________
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