edmcouncil / ontology-publisher

The owl-builder "builds" publishable / deployable versions (and derived products) of a given set of ontologies (such as FIBO)
MIT License
7 stars 6 forks source link

ontology_collector.py: fix parsing of remote data provided via URL #161

Closed przemekgradzki closed 4 months ago

przemekgradzki commented 4 months ago

Steps to reproduce (assuming python3 is installed):

# install "rdflib" library
pip install rdflib
# clone repository
git clone https://github.com/edmcouncil/ontology-publisher

python3 ontology-publisher/publisher/lib/ontology_collector.py \
  --input_ontology http://purl.org/spar/deo \
  --ontology-mapping <(echo '') \
  --output_ontology deo.ttl

returns empty deo.ttl file and error:

Exception occurred while getting imported ontology No plugin registered for (text/html, <class 'rdflib.parser.Parser'>)

while http://purl.org/spar/deo is the location of the correct graph, resolvable using a query compliant with the SPARQL 1.1 Graph Store HTTP Protocol, Direct Graph Identification, which can be executed with the following command:

curl -L -H 'Accept: text/turtle; charset=utf-8' http://purl.org/spar/deo

returns correct content consistent with RDF 1.1 Turtle