I want to put RDF/XML format directly in SDB

52 Views Asked by At

In Jena, I saved RDF/XML documents in SDB using the "read()" method and even created a file with RDF/XML documents in SDB using the "write" method. What I want to try is to save Triple directly in SDB.

Here is my code

prefix = "http://example.org/terms/";
ns = "ex";
model.setNsPrefix(ns, prefix);
prefix3 = "http://www.w3.org/1999/02/22-rdf-syntax-ns";
ns3 = "rdf";
model.setNsPrefix(ns3, prefix3);
prefix6 = "http://www.test/2022/#";
ns6 = "base";
model.setNsPrefix(ns6, prefix6);
            for(i = 0; i<index; i++) {
            Resource s_A = model.createResource(A[i].o);        
            Property p_A = model.createProperty(prefix3);                       
            Resource s_B = model.createResource(B[i].s);        
            Property p_B = model.createProperty(B[i].p);                        
            Resource s_C = model.createResource(C[i].s);        
            Property p_C = model.createProperty(C[i].p);        
            
            //model.add(s_A, p_A, prefix6); //wish <ex:Description rdf:about=baseURI+"ID">
            model.add(s_A, p_B, B[i].o);    //wish <ex:Description.type>1</ex:Description.type>
            model.add(s_A, p_C, C[i].o);    //wish <ex:Description.open>0</ex:Description.open>
                                            //wish </ex:Description>
            }

I know this(model.add(s_A, p_A, prefix6);) part is wrong, but I don't know which method I use to wish. I don't know what else to do here.

0

There are 0 best solutions below