Re: [dev] java rdf problem again

2010-03-25 Thread Andrea Chiumenti
why every now and then I have a failure message from
mailer-dae...@powermail.ce.net.cn

?

2010/3/25 Niklas Nebel 

> On 03/25/10 08:47, Andrea Chiumenti wrote:
>
>> Sorry I'm a bit confused, and browsing the site and using google I'm not
>> able to get a solution.
>>
>> I've also tried with
>> XURI nodeTableName = URI.create(m_xContext, "tableName");
>>
>> but I get this error:
>> CURI::initialize: argument not splittable: no separator [#/:]
>>
>> Could you please give me a sample snippet ?
>>
>
> Just use something like
> XURI nodeTableName = URI.create(m_xContext, "
> http://www.wingstech.it/gam3/v1.0/tableName";);
>
> One more thing: To get the URI for removeMetadataFile, you shouldn't use
> getURL from the XModel interface. Better use the document's XURI interface
> (parent of XDocumentMetadataAccess), so you always get the exact URI that
> the rdf implementation expects.
>
>
> Niklas
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
> For additional commands, e-mail: dev-h...@openoffice.org
>
>


Re: [dev] java rdf problem again

2010-03-25 Thread Niklas Nebel

On 03/25/10 08:47, Andrea Chiumenti wrote:

Sorry I'm a bit confused, and browsing the site and using google I'm not
able to get a solution.

I've also tried with
XURI nodeTableName = URI.create(m_xContext, "tableName");

but I get this error:
CURI::initialize: argument not splittable: no separator [#/:]

Could you please give me a sample snippet ?


Just use something like
XURI nodeTableName = URI.create(m_xContext, 
"http://www.wingstech.it/gam3/v1.0/tableName";);


One more thing: To get the URI for removeMetadataFile, you shouldn't use 
getURL from the XModel interface. Better use the document's XURI 
interface (parent of XDocumentMetadataAccess), so you always get the 
exact URI that the rdf implementation expects.


Niklas

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



Re: [dev] java rdf problem again

2010-03-25 Thread Andrea Chiumenti
Sorry I'm a bit confused, and browsing the site and using google I'm not
able to get a solution.

I've also tried with
XURI nodeTableName = URI.create(m_xContext, "tableName");

but I get this error:
CURI::initialize: argument not splittable: no separator [#/:]

Could you please give me a sample snippet ?

cheers,
kiuma


2010/3/24 Niklas Nebel 

> On 03/24/10 16:33, Andrea Chiumenti wrote:
>
>>XURI nodeTableName = URI.create(m_xContext, "gam3:tableName");
>>
>
>  The code generates this rdf file:
>>
>> 
>> http://www.w3.org/1999/02/22-rdf-syntax-ns#";>
>>  http://.wingstech.it/gam3/v1.0";>
>>A_TABLE
>>12345
>>  
>> 
>>
>> What I needed was instead something like this:
>>
>> 
>> http://www.w3.org/1999/02/22-rdf-syntax-ns#";>
>>  http://.wingstech.it/gam3/v1.0";>
>>A_TABLE
>>12345
>>  
>> 
>>
>
> In the URI.create call, the parameter should include the namespace URI, not
> the prefix. A prefix (like "ns1") is then generated. You can see it in the
> example output: If "gam3:" was replaced by something like "
> http://www.wingstech.it/gam3/v1.0/";, it would be equivalent to the second
> fragment (except for the namespace definition, which is missing there).
>
> Niklas
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
> For additional commands, e-mail: dev-h...@openoffice.org
>
>


Re: [dev] java rdf problem again

2010-03-24 Thread Niklas Nebel

On 03/24/10 16:33, Andrea Chiumenti wrote:

XURI nodeTableName = URI.create(m_xContext, "gam3:tableName");



The code generates this rdf file:


http://www.w3.org/1999/02/22-rdf-syntax-ns#";>
  http://.wingstech.it/gam3/v1.0";>
A_TABLE
12345
  


What I needed was instead something like this:


http://www.w3.org/1999/02/22-rdf-syntax-ns#";>
  http://.wingstech.it/gam3/v1.0";>
A_TABLE
12345
  



In the URI.create call, the parameter should include the namespace URI, 
not the prefix. A prefix (like "ns1") is then generated. You can see it 
in the example output: If "gam3:" was replaced by something like 
"http://www.wingstech.it/gam3/v1.0/";, it would be equivalent to the 
second fragment (except for the namespace definition, which is missing 
there).


Niklas

-
To unsubscribe, e-mail: dev-unsubscr...@openoffice.org
For additional commands, e-mail: dev-h...@openoffice.org



[dev] java rdf problem again

2010-03-24 Thread Andrea Chiumenti
Hello,
I've a problem with following code:

try
{
XDocumentMetadataAccess xDMA = (XDocumentMetadataAccess)
UnoRuntime.queryInterface(XDocumentMetadataAccess.class, xModel);
XURI xType = URI.create(m_xContext, "http://.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:



http://www.w3.org/1999/02/22-rdf-syntax-ns#";>
  http://.wingstech.it/gam3/v1.0";>
A_TABLE
12345
  


What I needed was instead something like this:


http://www.w3.org/1999/02/22-rdf-syntax-ns#";>
  http://.wingstech.it/gam3/v1.0";>
A_TABLE
12345
  


How can I do ?

Thanks in advance,
kiuma