Hi there,
My problem is that whenever I try to export a node, from RDF node tab, the node is exported like the following:
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:ns0="Arraytitle"
xmlns:ns1="Arraydate"
xmlns:ns2="Arraycreated"
xmlns:ns3="Arrayhas_creator"
xmlns:ns4="Arraynum_replies">
<rdf:Description rdf:about="[base_url]node/3">
<rdf:type>ArrayDocument</rdf:type>
<ns0:>Node One</ns0:>
<ns1: rdf:datatype="ArraydateTime">2010-12-18T18:57:39+02:00</ns1:>
<ns2: rdf:datatype="ArraydateTime">2010-12-18T18:57:39+02:00</ns2:>
<ns3: rdf:resource="[base_url]user/1"/>
<ns4: rdf:datatype="Arrayinteger">0</ns4:>
</rdf:Description>
</rdf:RDF>
I've installed rdfui, rdfx and evoc module from latest dev of rdf module, also I imported all core vocabs.
Also, a drupal message gets appeared after a refresh:
Warning: Illegal offset type in ARC2_RDFSerializer->__init() (line 27 of sites/all/modules/rdf/vendor/arc/serializers/ARC2_RDFSerializer.php).
Warning: Illegal offset type in ARC2_RDFSerializer->__init() (line 27 of sites/all/modules/rdf/vendor/arc/serializers/ARC2_RDFSerializer.php).
Warning: Illegal offset type in ARC2_RDFSerializer->__init() (line 27 of sites/all/modules/rdf/vendor/arc/serializers/ARC2_RDFSerializer.php).
Warning: Illegal offset type in ARC2_RDFSerializer->__init() (line 27 of sites/all/modules/rdf/vendor/arc/serializers/ARC2_RDFSerializer.php).
Warning: Illegal offset type in ARC2_RDFSerializer->__init() (line 27 of sites/all/modules/rdf/vendor/arc/serializers/ARC2_RDFSerializer.php).
Warning: Illegal offset type in ARC2_RDFSerializer->__init() (line 27 of sites/all/modules/rdf/vendor/arc/serializers/ARC2_RDFSerializer.php).
Warning: Illegal offset type in ARC2_RDFSerializer->__init() (line 27 of sites/all/modules/rdf/vendor/arc/serializers/ARC2_RDFSerializer.php).
Warning: Illegal offset type in ARC2_RDFSerializer->__init() (line 27 of sites/all/modules/rdf/vendor/arc/serializers/ARC2_RDFSerializer.php).
Warning: Illegal offset type in ARC2_RDFSerializer->__init() (line 27 of sites/all/modules/rdf/vendor/arc/serializers/ARC2_RDFSerializer.php).
Please let me know if you need further info.
Thanks
Comments
Comment #1
Anonymous (not verified) commentedThis is because of a change in the ARC 2 library. I had the same problem when trying out SPARQL Endpoint, #965010: rdf:type values show up as arrays. Scor suggested a temp fix of just downloading the earlier version of ARC 2 and that worked in my case.
Comment #2
Remon commentedI tried out an old arc version from bazaar repository as well as the one on github/scor/rdf, the bug remains though.
Comment #3
Remon commentedActually this happens because namespaces list has some duplicated namespace declaration, for example, skos namespace refers to an Array which has skos full url twice instead of referring to a string. could be a problem of hook_rdf_namespaces or something.
Comment #4
Remon commentedFor now, I use a dirty patch the make sure that namespaces are not duplicated.
Comment #5
ebremer commentedI got the same error you did Remon. I even removed RDFx (and submodules), as well as, RDF (core) and uninstalled them all, then installed scor's rdfx (with earlier arc2) and I still got the same error. If I apply your patch, it will export the rdf, but, I don't get all of the RDF, only name and account are exported. I added Last Name and First Name with foaf:firstname and foaf:lastname respectively, but they don't show up.
Comment #6
shunting commented#1 did not work for me.
#4's "dirty patch" did.
Comment #7
datorres commentedI have th same problem, but when I try to generate the rdf file I have this : Error de lectura XML: declaración de texto o XML en un lugar distinto del principio de la entidad
Comment #8
datorres commentedI have the same problem. You find solution?
If I apply your patch, it will export the rdf, but, I don't get all of the RDF, only name and account are exported. I added Last Name and First Name with foaf:firstname and foaf:lastname respectively, but they don't show up.
Comment #9
scor commented@datorres: "I added Last Name and First Name with foaf:firstname and foaf:lastname respectively, but they don't show up." this should be in a seprate issue, it seems unrelated.
Comment #10
scor commentedThe problems comes when evoc has imported the core vocabularies and redefined the core namespace. the core function rdf_get_namespaces() was fixed some time ago to strip out any duplicate, so it should really be used instead of a custom function. I've committed a fix which uses the core API directly instead to avoid duplicates.
We should however not need rdfx_get_namespaces() at all, if only for the static caching, which is important in the case of evoc which hits the database. Two options:
1. add static cache in rdf_get_namespaces() in core
2. add static cache inside evoc_rdf_namespaces()
I prefer 2, but that should be a separate performance issue really.
Comment #11
scor commentedrepurposing this issue to clean up rdfx.
Comment #12
Remon commentedWell, In my humble opinion Option 1 is preferable and is a global fix. A separate issue should be opened on core rdf.
Comment #13
Remon commenteda patch that removes depending on rdfx_get_namespaces()... if I may :)
Comment #14
Remon commentedrelated core rdf issue #1089040: Cache rdf_get_namespaces using drupal_static
Comment #15
scor commentedComment #16
scor commentedhow about removing this function entirely? I doubt this is used elsewhere in contrib...
Comment #17
scor commentedThis needs reroll since the RDF export API has changed.
Comment #18
scor commentedtagging
Comment #19
Anonymous (not verified) commentedThis should also be checked against coding standards. For example, the TODO statements should be @todo.
Comment #20
scor commentedyou can ignore the hunk from evoc.module and rdfx.terms.inc, it will be removed by another patch. rdfx_get_namespaces() will also go away in another patch.
Comment #21
mlncn commentedThis patch is postponed then until Remon's #1089040: Cache rdf_get_namespaces using drupal_static gets into Drupal 7 core and the evoc.module and rdfx.terms.inc parts are removed, because without any of that it is nothing but checking coding standards against comments and code that won't be here anymore...