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

Parser error #41

Closed
ZiyaUsta opened this issue Mar 26, 2023 · 2 comments
Closed

Parser error #41

ZiyaUsta opened this issue Mar 26, 2023 · 2 comments
Assignees
Labels
bug Something isn't working technical

Comments

@ZiyaUsta
Copy link

Can not parse CityGML file for transforming it to rdf. I receive this error:

Traceback (most recent call last):
File "./XML2RDF.py", line 899, in
main()
File "./XML2RDF.py", line 28, in main
transformer = XML2RdfTransformer(args)
File "./XML2RDF.py", line 74, in init
self.ontology.parse(path, format='xml')
File "/opt/anaconda3/lib/python3.8/site-packages/rdflib/graph.py", line 1494, in parse
parser.parse(source, self, **args)
File "/opt/anaconda3/lib/python3.8/site-packages/rdflib/plugins/parsers/rdfxml.py", line 647, in parse
self._parser.parse(source)
File "/opt/anaconda3/lib/python3.8/xml/sax/expatreader.py", line 111, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/opt/anaconda3/lib/python3.8/xml/sax/xmlreader.py", line 125, in parse
self.feed(buffer)
File "/opt/anaconda3/lib/python3.8/xml/sax/expatreader.py", line 221, in feed
self._err_handler.fatalError(exc)
File "/opt/anaconda3/lib/python3.8/xml/sax/handler.py", line 38, in fatalError
raise exception
xml.sax._exceptions.SAXParseException: https://dataset-dl.liris.cnrs.fr/rdf-owl-urban-data-ontologies/Ontologies/CityGML/2.0/:1:54: syntax error

So I suspect parser can not parse sample CityGML file correctly

@DiegoVinasco
Copy link
Contributor

I think I see the problem.

Currently, the XML2RDF transformer can parse either:

  • a URL that resolves to a file
  • a local file path that resolves to a directory (and will try to recursively parse rdf files in the directory)
  • or a local file path that resolves to a file

But the link https://dataset-dl.liris.cnrs.fr/rdf-owl-urban-data-ontologies/Ontologies/CityGML/2.0/ resolves to a directory on an online file server (which the file parser, RDFlib, can't parse).

What happens if you try pointing to a file on the online file server like https://dataset-dl.liris.cnrs.fr/rdf-owl-urban-data-ontologies/Ontologies/CityGML/2.0/core.ttl

or ...

After cloning this repository try pointing to a directory containing local ontologies like [path to repository]/UD-Graph/Ontologies/CityGML/2.0

Also, could you provide the arguments you're passing to the XML2RDF transformer?

@DiegoVinasco DiegoVinasco self-assigned this Apr 5, 2023
@DiegoVinasco DiegoVinasco added bug Something isn't working technical labels Apr 5, 2023
@DiegoVinasco
Copy link
Contributor

The latest PR included some updates to how the XML2RDF transformer parses input files. This may have fixed this bug if it isn't related to my previous comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working technical
Projects
None yet
Development

No branches or pull requests

2 participants