RDFLib / pyLODE

An OWL ontology documentation tool using Python and templating, based on LODE
BSD 3-Clause "New" or "Revised" License
175 stars 70 forks source link

AttributeError rendering concept hierarchy with vocpub profile (rendering a SKOS taxonomy) #97

Open zednis opened 4 years ago

zednis commented 4 years ago

I am trying to generate a vocpub rendering of a SKOS taxonomy I manage.

I have used riot to verify that the taxonomy is a good RDF file and a SPARQL query to verify that

  1. there are no cycles in the taxonomy
  2. For every skos:broader there is a corresponding skos:narrower
  3. All concepts with no skos:broader relation are skos:hasTopConcept of the ConceptScheme

When I run pylode with the vocpub profile I get an attribute error while trying to render the concept hierarchy. Does anyone have an idea on what might be causing this?

command:

pylode -i skills.ttl -o DHI_SKILLS -p vocpub -f md

output:

Traceback (most recent call last):
  File "/Users/stephan.zednik/.pyenv/versions/3.8.5/bin/pylode", line 8, in <module>
    sys.exit(main())
  File "/Users/stephan.zednik/.pyenv/versions/3.8.5/lib/python3.8/site-packages/pylode/cli.py", line 181, in main
    h.document(destination=output_file_name)
  File "/Users/stephan.zednik/.pyenv/versions/3.8.5/lib/python3.8/site-packages/pylode/common.py", line 182, in document
    doc = p.generate_document()
  File "/Users/stephan.zednik/.pyenv/versions/3.8.5/lib/python3.8/site-packages/pylode/profiles/vocpub.py", line 602, in generate_document
    self._make_concept_hierarchy()
  File "/Users/stephan.zednik/.pyenv/versions/3.8.5/lib/python3.8/site-packages/pylode/profiles/vocpub.py", line 504, in _make_concept_hierarchy
    txt += _render(tc, self.CONCEPTS.get(tc).get("narrowers"), self.outputformat, 0)
  File "/Users/stephan.zednik/.pyenv/versions/3.8.5/lib/python3.8/site-packages/pylode/profiles/vocpub.py", line 485, in _render
    md += _render(ch, self.CONCEPTS.get(ch).get("narrowers"), of, level=level + 1)
  File "/Users/stephan.zednik/.pyenv/versions/3.8.5/lib/python3.8/site-packages/pylode/profiles/vocpub.py", line 485, in _render
    md += _render(ch, self.CONCEPTS.get(ch).get("narrowers"), of, level=level + 1)
  File "/Users/stephan.zednik/.pyenv/versions/3.8.5/lib/python3.8/site-packages/pylode/profiles/vocpub.py", line 485, in _render
    md += _render(ch, self.CONCEPTS.get(ch).get("narrowers"), of, level=level + 1)
AttributeError: 'NoneType' object has no attribute 'get'
nicholascar commented 4 years ago

@zednis can you please send me the vocab file to test with? I can properly debug then. Just email it to me, if its not too large, on nicholas.car@surroundaustralia.com.