Protege converts owl1 to owl2 when edit and save

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

Protege converts owl1 to owl2 when edit and save

madushan
We have a set of owl files which are generated using apache jena 3.2.0. we are using protege to to edit/analyze those, protege version is 5.2.0 .we opened an owl file from protege and then edit some properties of Individuals then save the changes. Afterwards when I check the owl file opening via notepad++ or any text editor format of content in the file has been changed to owl2. I'm saying it's owl2 because i see individuals before have been changed as NamedIndividual. NamedIndividuals are from owl2 not owl1. Original file was owl1. It got changed only after saving the edited changes done from protege. And also for some owl1 files I noticed they have been changed to RDF after changes been saved. Note that this can only been seen only if you open the owl file using a text editor after a change is saved. Even though the content is changed to rdf file extension was still as .owl . Is this an expected behavior? Since protege was able to read an owl1 file since file can be opened with out any issue why does it not saving it from the same format?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Protege converts owl1 to owl2 when edit and save

Matthew Horridge-2
Administrator
Hi,

Protege saves ontologies in the same format in which they were opened.  If the original file was written in RDF/XML syntax then it will be saved in RDF/XML.  If the original file was written in Turtle syntax then it will be saved in Turtle syntax etc.  What was the original syntax of your ontology document/file? (I’m guessing it’s an RDF-based syntax as you’re using Jena).

With regards to owl:NamedIndividual, yes this was introduced in OWL 2.  However, if you’re working with Jena then it should be able to process this without any problems - it’s one extra triple per individuals e.g.  :myIndividual a owl:NamedIndividual.  You can just ignore these triples (filter them out).

Cheers,

Matthew




> On 10 Aug 2017, at 12:06, madushan <[hidden email]> wrote:
>
> We have a set of owl files which are generated using apache jena 3.2.0. we
> are using protege to to edit/analyze those, protege version is 5.2.0 .we
> opened an owl file from protege and then edit some properties of Individuals
> then save the changes. Afterwards when I check the owl file opening via
> notepad++ or any text editor format of content in the file has been changed
> to owl2. I'm saying it's owl2 because i see individuals before have been
> changed as NamedIndividual. NamedIndividuals are from owl2 not owl1.
> Original file was owl1. It got changed only after saving the edited changes
> done from protege. And also for some owl1 files I noticed they have been
> changed to RDF after changes been saved. Note that this can only been seen
> only if you open the owl file using a text editor after a change is saved.
> Even though the content is changed to rdf file extension was still as .owl .
> Is this an expected behavior? Since protege was able to read an owl1 file
> since file can be opened with out any issue why does it not saving it from
> the same format?
>
>
>
> --
> View this message in context: http://protege-project.136.n4.nabble.com/Protege-converts-owl1-to-owl2-when-edit-and-save-tp4669376.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
|  
Report Content as Inappropriate

Re: Protege converts owl1 to owl2 when edit and save

madushan

Original Syntax is RDF/XML.Are you saying the reason behind this is because the syntax is RDF/XML?

    <onto:child rdf:about="https://www.example.com/onto/child/jonsnow">
             <onto:familyname>stark</onto:familyname>
             <onto:age>25
    </onto:child>

This is an one Individual created out of owl class "Child" which is a subclass of "Thing". familyname and age are owl DataTypeProperties. Apache Jena does not support owl2 therefore we can not achieve the features of owl2 using apache jena. Using apache jena we were not able to get elements as NamedIndividual.
How would some files end up with change in format of the original. Like it would end up file content format being changed. It would some how Change the content of original file. Thank you for the support appreciate if you lend your further support in regards of solving this.

Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Protege converts owl1 to owl2 when edit and save

Matthew Horridge-2
Administrator
Hi,

> Original Syntax is RDF/XML.Are you saying the reason behind this is because
> the syntax is RDF/XML?

Yes.  This is RDF/XML so Protege will save the ontology as RDF/XML.  Please be aware that there are several abbreviations that can be used in RDF/XML so the exact concrete syntax produced by Protege may not be the same as that produced by Jena, but once parsed the resulting triples should be the same.  For example,

<onto:A rdf:about=“myIndividual”/>

is exactly the same (single) triple as

<rdf:Description rdf:about=“myIndividual”>
        <rdf:type rdf:about=“A”/>
</rdf:Description>

but the two serialisations are not structurally the same.

>    <onto:child rdf:about="https://www.example.com/onto/child/jonsnow">
>             <onto:familyname>stark</onto:familyname>
>             <onto:age>25
>    </onto:child>
>
> This is an one Individual created out of owl class "Child" which is a
> subclass of "Thing". familyname and age are owl DataTypeProperties. Apache
> Jena does not support owl2 therefore we can not achieve the features of owl2
> using apache jena. Using apache jena we were not able to get elements as
> NamedIndividual.

I imagine that Jena will just interpret the type triple just like any other triple without a specific OWL 1 meaning.  You should just be able to ignore it.

> How would some files end up with change in format of the original. Like it
> would end up file content format being changed. It would some how Change the
> content of original file. Thank you for the support appreciate if you lend
> your further support in regards of solving this.

It sounds like both formats are RDF/XML but as I say above, Protege just produced a slightly different variant of it.

Cheers,

Matthew



>
> Thanks
>
>
>
> --
> View this message in context: http://protege-project.136.n4.nabble.com/Protege-converts-owl1-to-owl2-when-edit-and-save-tp4669376p4669378.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
|  
Report Content as Inappropriate

Re: Protege converts owl1 to owl2 when edit and save

madushan
In reply to this post by madushan
Hi,

I know this not the jena support thread but just for clarification i would like to post this https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/vocabulary/OWL2.html.

Thanks,
Madushan.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Protege converts owl1 to owl2 when edit and save

madushan
In reply to this post by Matthew Horridge-2
Thanks Matthew. Problem is much more clear now than it was before.

Thanks,
Madushan.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Protege converts owl1 to owl2 when edit and save

Matthew Horridge-2
Administrator
You’re welcome!

> On 10 Aug 2017, at 12:43, madushan <[hidden email]> wrote:
>
> Thanks Matthew. Problem is much more clear now than it was before.
>
> Thanks,
> Madushan.
>
>
>
> --
> View this message in context: http://protege-project.136.n4.nabble.com/Protege-converts-owl1-to-owl2-when-edit-and-save-tp4669376p4669381.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
|  
Report Content as Inappropriate

Re: Protege converts owl1 to owl2 when edit and save

madushan
Hi

As you have mentioned....

<onto:A rdf:about=“myIndividual”/> 

is exactly the same (single) triple as

<rdf:Description rdf:about=“myIndividual”> 
        <rdf:type rdf:about=“A”/> 
</rdf:Description> 

If protege is converting to different RDF/XML serialization , shouldn't it be able to open the same file again from protege? but in this case it throws an exception if I try to reload the same file 'org.semanticweb.owlapi.rdf.rdfxml.parser.RDFParserException'. is this becasue two different parsers? since we have used jena and protege using owlapi

Thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Protege converts owl1 to owl2 when edit and save

madushan
In reply to this post by Matthew Horridge-2
Hi,

I have tested the same file to edit and save using protege 3.5 it would not convert
<onto:child rdf:about="https://www.example.com/onto/child/jonsnow"> element to a NamedIndividual nor  to something like this ,
<rdf:Description rdf:about=“jonsnow”> 
        <rdf:type rdf:about=“child”/> 
</rdf:Description>

Thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Protege converts owl1 to owl2 when edit and save

Lorenz Buehmann
Protege 4.x/5.x uses the OWL API to process the ontology. And the OWL
API nowadays uses the OWL 2 constructs for good reasons. Indeed, when
you write the ontology back to disk, it uses those OWL constructs. And
this is absolutely correct as it's following the standard.

Protege 3.5 is based on some old API.


On 11.08.2017 14:33, madushan wrote:

> Hi,
>
> I have tested the same file to edit and save using protege 3.5 it would not
> convert
> <onto:child rdf:about="https://www.example.com/onto/child/jonsnow"> element
> to a NamedIndividual nor  to something like this ,
> <rdf:Description rdf:about=“jonsnow”>
>         <rdf:type rdf:about=“child”/>
> </rdf:Description>
>
> Thanks.
>
>
>
> --
> View this message in context: http://protege-project.136.n4.nabble.com/Protege-converts-owl1-to-owl2-when-edit-and-save-tp4669376p4669389.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
Loading...