Hey there,
currently, I am struggling with the API. My goal is to load an ontologie and manually add new triples.
Loading is not a problem and I am also able to inspect the triples that I loaded.
In order to add new triples I assume that I will have to use the method
owlcpp::Triple triple = owlcpp::Triple::make(c4, type, clazz, docid); triple_store.insert(triple)
I am also able to create a new node via :::C++ owlcpp::Node_id c4 = triple_store.insert_node_iri("http://owl-cpp.sf.net/test/owl/test_01.owl#C4");
In addition, I can obtain the docid via
triple_store.find_doc_iri("http://owl-cpp.sf.net/test/owl/test_01.owl")
But I am lost in obtaining the node ids for type and clazz For type I want to use the node id for the node rdf:type and for class the node id for owl:Class
I can retrieve the respective node by calling
const owlcpp::Node& clazz = triple_store.at(owlcpp::terms::owl_Class::id());
But: How do get from the node to the node id. The nodes feature an attribute ns_id but not a node_id.
Any help in obtaining these node ids is appreciated.
Dirk
It was that obvious that I did not see it. There are constants defined that can be used for that purpose
owlcpp::terms::rdf_type::id() owlcpp::terms::owl_Class::id()
Log in to post a comment.
Hey there,
currently, I am struggling with the API. My goal is to load an ontologie and manually add new triples.
Loading is not a problem and I am also able to inspect the triples that I loaded.
In order to add new triples I assume that I will have to use the method
I am also able to create a new node via
:::C++
owlcpp::Node_id c4 = triple_store.insert_node_iri("http://owl-cpp.sf.net/test/owl/test_01.owl#C4");
In addition, I can obtain the docid via
But I am lost in obtaining the node ids for type and clazz
For type I want to use the node id for the node rdf:type and for class the node id for owl:Class
I can retrieve the respective node by calling
But: How do get from the node to the node id. The nodes feature an attribute ns_id but not a node_id.
Any help in obtaining these node ids is appreciated.
Dirk
It was that obvious that I did not see it. There are constants defined that can be used for that purpose
Last edit: Dirk Schnelle-Walka 2015-07-01