Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolving entity values with nested entities #110

Closed
filippodebortoli opened this issue Dec 1, 2022 · 0 comments
Closed

Resolving entity values with nested entities #110

filippodebortoli opened this issue Dec 1, 2022 · 0 comments

Comments

@filippodebortoli
Copy link
Contributor

I am trying to get RdfXmlParser to parse a file that contains entities whose defined in terms of other entities, as rdf and rdfs in the following example:

<?xml version="1.0"?>

<!DOCTYPE rdf:RDF [
  <!ENTITY ex "http://example.com/">
  <!ENTITY w3 "http://www.w3.org">
  <!ENTITY rdf "&w3;/1999/02/22-rdf-syntax-ns#">
  <!ENTITY rdfs "&w3;/2000/01/rdf-schema#">
  <!ENTITY xsd "&w3;/2001/XMLSchema#">
]>

<rdf:RDF xmlns:ex2="&ex;2/" xmlns:rdf="&rdf;">
	<rdf:Description rdf:about="&ex;foo">
	    <ex2:test rdf:datatype="&xsd;string">bar</ex2:test>
	</rdf:Description>
</rdf:RDF>

It seems that the parser is not performing entity resolution while parsing doctypes.
I have to admit that I am unsure whether the code above is well-formed, I encountered a situation of this kind while working with a seemingly established ontology.
I am trying to add this capability to the parser by modifying parser::parse_doctype().
I am going to address this issue in a pull request.

Am I missing some capabilities of RdfXmlParser that would allow me to get the parser to work on this example without changing code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant