Hello,
I am using owlready2 for:
1-Read a source ontology
2-If individuals have a particular annotation
3- I create a class with the same uri in the target ontology
I use a sparql query for find individuals and an insert query with parameter
owlready2 gives me this error.
python-BaseException
Traceback (most recent call last):
File "/home/bernard/.local/lib/python3.7/site-packages/rdflib/plugin.py", line 100, in get
p = _plugins[(name, kind)]
TypeError: unhashable type: 'list'
Best Regards,
Bernard
PS1 :
ontoSource = default_world.get_ontology(args.source).load()
worldCible = World()
ontoCible = worldCible.get_ontology(args.cible).load()
graph = default_world.as_rdflib_graph()
graph2 = worldCible.as_rdflib_graph()
#
http://www.semanticweb.org/CyberOntology#isConcept extract = list(graph.query("""
PREFIX cyber:<
http://www.semanticweb.org/CyberOntology#>
SELECT ?concept ?annotation WHERE {
?concept cyber:isConcept ?annotation .
}"""))
for i in extract:
URIconcept = str(i[0])
if annotation == "True":
graph2.update("""
PREFIX owl: <
http://www.w3.org/2002/07/owl#>
PREFIX rdf: <
http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <
http://www.w3.org/2000/01/rdf-schema#>
INSERT {??1 a owl:Class.
??1 rdfs:subClassOf owl:Thing}
WHERE {}
""", [URIconcept])