I'm new to RDF – I'm only diving into this stuff because I want to transform the MITRE D3FEND ontology. Their ontology has a number of data properties I need - but they include the - character in the name, which is not working with Python's dot notation.
Here's my simple code to demonstrate what I'm trying to do, and where it's falling over:
from owlready2 import *
onto = get_ontology("https://d3fend.mitre.org/ontologies/d3fend.owl")
for level1 in onto.DefensiveTechnique.subclasses():
for level2 in level1.subclasses():
print("%s: %s" % (level1.label, level2.label))
print("%s" % (level2.d3fend-id))
Obviously the "d3fend-id" property isn't working since Python parses it as a minus operator.