Hello,
I've a problem with following code:
try
{
XDocumentMetadataAccess xDMA = (XDocumentMetadataAccess)
UnoRuntime.queryInterface(XDocumentMetadataAccess.class, xModel);
XURI xType = URI.create(m_xContext, "http://wwww.wingstech.it/gam3/v1.0
");
try {
xDMA.removeMetadataFile(URI.create(m_xContext, xDoc.getURL() +
"/gam3/dbinfo.rdf"));
}
catch (java.lang.Exception eRemove)
{
}
XURI xGraphName = xDMA.addMetadataFile("gam3/dbinfo.rdf", new XURI[]
{
xType
});
XNamedGraph xGraph = xDMA.getRDFRepository().getGraph(xGraphName);
XURI nodeTableName = URI.create(m_xContext, "gam3:tableName");
XLiteral valTableName = Literal.create(m_xContext, "A_TABLE");
xGraph.addStatement(xType, nodeTableName, valTableName);
XURI nodeTableId = URI.create(m_xContext, "gam3:tableId");
XLiteral valTableId = Literal.create(m_xContext, "12345");
xGraph.addStatement(xType, nodeTableId, valTableId);
}
catch (java.lang.Exception e)
{
e.printStackTrace();
showMessageError("ERROR rdf", e);
}
The code generates this rdf file:
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://wwww.wingstech.it/gam3/v1.0">
<ns1:tableId xmlns:ns1="gam3:">A_TABLE</ns1:tableId>
<ns2:tableName xmlns:ns2="gam3:">12345</ns2:tableName>
</rdf:Description>
</rdf:RDF>
What I needed was instead something like this:
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://wwww.wingstech.it/gam3/v1.0">
<gam3:tableId>A_TABLE</gam3:tableId>
<gam3:tableName>12345</gam3:tableName>
</rdf:Description>
</rdf:RDF>
How can I do ?
Thanks in advance,
kiuma