Menu

Manual addition of triples

Help
2015-06-24
2015-06-26
  • Dirk Schnelle-Walka

    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

     
  • Dirk Schnelle-Walka

    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()
    
     

    Last edit: Dirk Schnelle-Walka 2015-07-01

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.