I think its important that this library work consistently with other RDF readers in case people choose to use other libraries to read OMEX metadata.
This illustrates a key departure that I think will likely create confusion. The root uri is ..
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
<rdf:Description rdf:about=".">
</rdf:RDF>
However, this library transforms this to http://omex-library.org/NewOmex.omex/.
import json
import pyomexmeta
rdf = pyomexmeta.RDF.from_file('tests/fixtures/omex-metadata/no-root.rdf', 'rdfxml')
query = "SELECT ?subject ?predicate ?object WHERE { ?subject ?predicate ?object }"
triples = json.loads(rdf.query_results_as_string(query, 'json'))['results']['bindings']
print(triples[0]['subject']['value'])
Instead, validation could be provided to assert that the URI must start with http://omex-library.org/ and end in .omex.
I think its important that this library work consistently with other RDF readers in case people choose to use other libraries to read OMEX metadata.
This illustrates a key departure that I think will likely create confusion. The root uri is
..However, this library transforms this to
http://omex-library.org/NewOmex.omex/.Instead, validation could be provided to assert that the URI must start with
http://omex-library.org/and end in.omex.