Exporting replaces quotes and apostrophes with " and '

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

Exporting replaces quotes and apostrophes with " and '

g.singh
Hi,

The file I imported into protege had this example line:

<skos:definition xml:lang="fr">This is G's Test</skos:definition>

I then exported the ontology as an RDF and the line looked like this:
<skos:definition xml:lang="fr">This is G&apos;s Test</skos:definition>

The same happens with lines that have double quotes. The exported file
contains &quot;.

I have tried looking on this forum as well as google searches. I think that
I might be missing some kind of plugin.

Any help on this would be very appreciated. Thank You!



--
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
Reply | Threaded
Open this post in threaded view
|

Re: Exporting replaces quotes and apostrophes with &quot; and &apos;

Wynne, Robert (NIH/NCI) [C]
To ensure xml will parse, there are five characters that should be escaped.  In addition to those two, the others are the ampersand, less than sign, and greater than sign.

These characters shouldn't need to be escaped in Comments and CDATA.

If you try a roundtrip with your export, you should find the OWL API deserializes the file as it should and Protégé displays the characters unescaped.

Rob

-----Original Message-----
From: g.singh [mailto:[hidden email]]
Sent: Monday, June 11, 2018 1:40 PM
To: [hidden email]
Subject: [protege-user] Exporting replaces quotes and apostrophes with &quot; and &apos;

Hi,

The file I imported into protege had this example line:

<skos:definition xml:lang="fr">This is G's Test</skos:definition>

I then exported the ontology as an RDF and the line looked like this:
<skos:definition xml:lang="fr">This is G&apos;s Test</skos:definition>

The same happens with lines that have double quotes. The exported file contains &quot;.

I have tried looking on this forum as well as google searches. I think that I might be missing some kind of plugin.

Any help on this would be very appreciated. Thank You!



--
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: Exporting replaces quotes and apostrophes with &quot; and &apos;

g.singh
Hello Rob,

Protege is able to open it but I have other scripts that scrape the rdf
files that i will be importing/exporting from protege so I'm wondering if
theres a way to preserve quotes and apostrophes when the ontology is
exported.

Thank You



--
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
Reply | Threaded
Open this post in threaded view
|

Re: Exporting replaces quotes and apostrophes with &quot; and &apos;

Wynne, Robert (NIH/NCI) [C]
You may need to modify the following class and rebuild the protege.jar.
 
edu.stanford.smi.protege.storage.xml.XMLUtil

Alternatively, instead of scraping the rdf file you could use the OWL API directly.

https://github.com/owlcs/owlapi/wiki/Documentation

Good luck!
Rob

-----Original Message-----
From: g.singh [mailto:[hidden email]]
Sent: Wednesday, June 13, 2018 3:09 PM
To: [hidden email]
Subject: Re: [protege-user] Exporting replaces quotes and apostrophes with &quot; and &apos;

Hello Rob,

Protege is able to open it but I have other scripts that scrape the rdf files that i will be importing/exporting from protege so I'm wondering if theres a way to preserve quotes and apostrophes when the ontology is exported.

Thank You



--
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: Exporting replaces quotes and apostrophes with &quot; and &apos;

Wynne, Robert (NIH/NCI) [C]
Sorry, I was looking at a much older version of Protégé.

You may need to modify this class and rebuild the owlapi-osgidistribution.jar.

org.semanticweb.owlapi.io.XMLUtils

Rob

-----Original Message-----
From: Wynne, Robert (NIH/NCI) [C]
Sent: Wednesday, June 13, 2018 4:08 PM
To: 'User support for WebProtege and Protege Desktop' <[hidden email]>
Subject: RE: [protege-user] Exporting replaces quotes and apostrophes with &quot; and &apos;

You may need to modify the following class and rebuild the protege.jar.
 
edu.stanford.smi.protege.storage.xml.XMLUtil

Alternatively, instead of scraping the rdf file you could use the OWL API directly.

https://github.com/owlcs/owlapi/wiki/Documentation

Good luck!
Rob

-----Original Message-----
From: g.singh [mailto:[hidden email]]
Sent: Wednesday, June 13, 2018 3:09 PM
To: [hidden email]
Subject: Re: [protege-user] Exporting replaces quotes and apostrophes with &quot; and &apos;

Hello Rob,

Protege is able to open it but I have other scripts that scrape the rdf files that i will be importing/exporting from protege so I'm wondering if theres a way to preserve quotes and apostrophes when the ontology is exported.

Thank You



--
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: Exporting replaces quotes and apostrophes with &quot; and &apos;

g.singh
Hi Rob,

Thank you for your help. I was finally able to get protege to work as
intended.

For those that are experiencing this in the future:

Everything I did can be found  here.
<https://github.com/owlcs/owlapi/issues/768#issuecomment-399617091>  



--
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