Re: RDF metadata, unable to read ?
underscore <[email protected]>
| Newsgroups | gmane.comp.openoffice.devel.general |
|---|---|
| Message-ID | <[email protected]> |
I think i found a bug in the rdf implementation -- the problem seems
to manifest if i give a particular kind of URI --
If i use this format "http://www.xyz.org/1.0" as the URI for the rdf
graph while saving :
Dim uriAnx
uriAnx = UriService.create("http://editor.bungeni.org/1.0" )
Dim rdfMetafile
rdfMetafile = odoc.addMetadataFile("meta/meta.rdf", Array(uriAnx))
In the above case the URI namespace is not recorded in manifest.rdf.
If i use this format "http://www.xyz.org/1.0/abc" as the URI for the
rdf graph while saving :
Dim uriAnx
uriAnx = UriService.create("http://editor.bungeni.org/1.0/anx" )
Dim rdfMetafile
rdfMetafile = odoc.addMetadataFile("meta/meta.rdf", Array(uriAnx))
It works fine and I am able to browse the graph names in the repository.
In this case the URI namespace is recorded in manifest.rdf
Is this a bug or valid behavior ?
The documentation is a bit ambiguous on this ....
<http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OfficeDev/RDF_metadata#Vocabulary>
On Thu, Feb 10, 2011 at 6:03 PM, underscore <[email protected]> wrote:
> I have a ODF document where I have applied RDF metadata (using the UNO
> API) to a textsection which looks like this :
>
> (met/meta.rdf)
>
> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> <rdf:Description rdf:about="../content.xml#id276852556">
> <ns1:sectionType
> xmlns:ns1="http://anx.bungeni.org/1.0/">Clause</ns1:sectionType>
> <ns2:sectionUUID
> xmlns:ns2="http://anx.bungeni.org/1.0/">1723-18388-38383-38383</ns2:sectionUUID>
> </rdf:Description>
> </rdf:RDF>
>
> I am unable to read it back --
>
> e.g. [1]
> <code>
> ....
> Dim rdfRepo
> rdfRepo = thisComponent.getRDFRepository()
> Dim arrGraphs
> arrGraphs = rdfRepo.getGraphNames()
>
> </code>
>
> In the above case ... getGraphNames() always returns an empty array !
>
> e.g. [2]
> <code>
> Dim uriAnx
> uriAnx = UriService.create("http://anx.bungeni.org/1.0" )
> Dim uriGraphs
> uriGraphs = thisComponent.getMetadataGraphsWithType(uriAnx)
> </code>
>
> In the above case too .... getMetadataGraphsWithType() returns a empty
> array ...but the document has the metadata.
>
> What am i doing wrong ? Is this not the way to retrieve the metadata graph ?
>
> Just for reference -- this is what the manifest.rdf looks like ----
>
> <?xml version="1.0" encoding="utf-8"?>
> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
> <ns1:Document
> xmlns:ns1="http://docs.oasis-open.org/ns/office/1.2/meta/pkg#"
> rdf:about="">
> <ns1:hasPart rdf:resource="content.xml"/>
> <ns1:hasPart rdf:resource="meta/meta.rdf"/>
> <ns1:hasPart rdf:resource="styles.xml"/>
> </ns1:Document>
> <ns2:StylesFile
> xmlns:ns2="http://docs.oasis-open.org/ns/office/1.2/meta/odf#"
> rdf:about="styles.xml"/>
> <ns3:ContentFile
> xmlns:ns3="http://docs.oasis-open.org/ns/office/1.2/meta/odf#"
> rdf:about="content.xml"/>
> </rdf:RDF>
>