I have tried some XML to JS conversion tools, but they never quite work on RDF XML, but do on regular XML documents.
So, for example, I have this:
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description xmlns:ns1="dc:" rdf:about="http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=3140">
<ns1:creator rdf:resource="https://fr.wikipedia.org/wiki/Katherine_Paterson"/>
</rdf:Description>
</rdf:RDF>
</xml>
Which seems to not play nice with, for example, the JQuery parser.
I am wondering..would this library help me with my goal?
Thanks so much
Michael Cabus
>>> from rdflib import Graph>>> g = Graph()>>> xml = """<?xml version="1.0"?>...... <rdf:RDF... xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"... xmlns:si="https://www.w3schools.com/rdf/">...... <rdf:Description rdf:about="https://www.w3schools.com">... <si:title>W3Schools</si:title>... <si:author>Jan Egil Refsnes</si:author>... </rdf:Description>...... </rdf:RDF>""">>> g.parse(data = xml)<Graph identifier=N5188733317044266a20c3957e8365a76 (<class 'rdflib.graph.Graph'>)>>>> print g.serialize(format = 'json-ld')[{"@id": "https://www.w3schools.com",{"@value": "Jan Egil Refsnes"}],{"@value": "W3Schools"}]}]>>>
–– Si vis pacem, bellum adflicta. ––
> > To unsubscribe from this group and stop receiving emails from it, send an email to rdflib-dev+unsubscribe@googlegroups.com.
> > To post to this group, send email to rdfli...@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/rdflib-dev/1d45e649-e2f8-47b9-ab96-fabfd0dac967%40googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
--
http://github.com/RDFLib
---
You received this message because you are subscribed to the Google Groups "rdflib-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdflib-dev+unsubscribe@googlegroups.com.
To post to this group, send email to rdfli...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rdflib-dev/e1ec15a8-103c-47e8-bfde-58c8c8a95416%40googlegroups.com.