thanks for that Stephen. If all else fails I can get round it by using 
addRelationship once the object is created.

Alistair

--------------
mov eax,1
mov ebx,0
int 80

On 30 Jul 2011, at 17:02, Stephen Bayliss wrote:

> Hi Alistair
> 
> This is unfortunately a known issue - see
> https://jira.duraspace.org/browse/FCREPO-796.  The XML content of inline
> datastreams within FOXML - that is the content within the <xmlContent>
> elements - has to be well-formed XML in its own right, so the namespace
> prefixes need declaring within that XML content.  (When processing the XML
> content, Fedora just takes it as it is, out of context of the overall FOXML
> document.)
> 
> An option if you can't get the XML tooling you are using to do this could be
> first to create the object and then add the datastream.
> 
> Otherwise I can only suggest that you try things like using explicit
> namespace prefixes in your elements where you are using the createElementNS
> method for example - specify a fully-qualified name like ns1:isCollection
> for example, maybe even try using different prefixes for those two elements
> - eg ns1:isCollection and ns2:owner; or perhaps adding an xmlns: element on
> the root RDF element explicitly defining the prefix there.  No guarantees
> that any of this will work though!
> 
> There have been a few threads about this in the past, eg
> http://fedora-commons.1317035.n2.nabble.com/fcrepo-user-Mandatory-placement-
> of-namespace-declarations-in-foxml-and-batchModify-td5906562.html.
> 
> Regards
> Steve
> 
>> -----Original Message-----
>> From: Alistair Young [mailto:alistair.yo...@uhi.ac.uk] 
>> Sent: 30 July 2011 15:44
>> To: Support and info exchange list for Fedora users.
>> Subject: Re: [fcrepo-user] API-M second RELS-EXT relationship 
>> on ingest fails
>> 
>> 
>> Hi Steven,
>> 
>> this is the ingest that causes the error:
>> 
>> The prefix "myns" for element "myns:owner" is not bound
>> 
>> it's always the second relationship that produces the not 
>> bound error, so I can swap them round and get the other one to fail
>> 
>> <digitalObject PID="demo:usercollection" VERSION="1.1" 
>> xsi:schemaLocation="info:fedora/fedora-system:def/foxml# 
>> http://www.fedora.info/definitions/1/0/foxml1-1.xsd"; 
>> xmlns="info:fedora/fedora-system:def/foxml#" 
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
>> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; 
>> xmlns:rel="http://www.nsdl.org/ontologies/relationships#";>
>>  <objectProperties>
>>    <property 
>> NAME="info:fedora/fedora-system:def/model#state" VALUE="A"/>
>>    <property 
>> NAME="info:fedora/fedora-system:def/model#label" 
>> VALUE="usercollection"/>
>>    <extproperty 
>> NAME="http://www.openarchives.org/OAI/1.1/oai-identifier.xsd"; 
>> VALUE="demousercollection"/>
>>  </objectProperties>
>>  <datastream ID="RELS-EXT" CONTROL_GROUP="X" VERSIONABLE="false">
>>    <datastreamVersion ID="RELS-EXT.0" MIMETYPE="text/xml" 
>> LABEL="Fedora Object-to-Object Relationship Metadata">
>>      <xmlContent>
>>        <rdf:RDF>
>>          <rdf:Description 
>> rdf:about="info:fedora/demo:usercollection">
>>            <rel:isCollection>true</rel:isCollection>
>>            <rel:owner>testowner</rel:owner>
>>          </rdf:Description>
>>        </rdf:RDF>
>>      </xmlContent>
>>    </datastreamVersion>
>>  </datastream>
>> </digitalObject>
>> 
>> Alistair
>> 
>> --------------
>> mov eax,1
>> mov ebx,0
>> int 80
>> 
>> On 30 Jul 2011, at 12:45, Stephen Bayliss wrote:
>> 
>>> Hi Alistair
>>> 
>>> Are you able to paste in the RDF/XML for RELS-EXT that that is 
>>> failing?
>>> 
>>> Steve
>>> 
>>>> -----Original Message-----
>>>> From: Alistair Young [mailto:alistair.yo...@uhi.ac.uk]
>>>> Sent: 30 July 2011 10:25
>>>> To: fedora-commons-users@lists.sourceforge.net
>>>> Subject: [fcrepo-user] API-M second RELS-EXT relationship on 
>>>> ingest fails
>>>> 
>>>> 
>>>> If I create an object with two relationships, the second
>>>> relationship always fails with the error:
>>>> 
>>>> The prefix "myns" for element "myns:owner" is not bound
>>>> 
>>>> if I switch them round, the previously successful one fails
>>>> with that error.
>>>> 
>>>>   Element rdfRoot =
>>>> rdfXmlContent.getDomNode().getOwnerDocument().createElementNS(
>>> "http://www.w3.org/1999/02/22-rdf-syntax-ns#";, > "RDF");
>>>> 
>>>>   Element rdfDescription =
>>>> rdfXmlContent.getDomNode().getOwnerDocument().createElementNS(
>>> "http://www.w3.org/1999/02/22-rdf-syntax-ns#";, > "Description");
>>>> 
>>>> rdfDescription.setAttributeNS("http://www.w3.org/1999/02/22-rd
>>>> f-syntax-ns#", "about", "info:fedora/" + schema + ":" +
>>>> collection.getTitle());
>>>>   rdfRoot.appendChild(rdfDescription);
>>>> 
>>>>   Element isCollection =
>>>> rdfXmlContent.getDomNode().getOwnerDocument().createElementNS(
>>> "http://www.nsdl.org/ontologies/relationships#";, "isCollection");
>>>   Text isCollectionTextNode = 
>>> 
>> rdfXmlContent.getDomNode().getOwnerDocument().createTextNode("true");
>>>   isCollection.appendChild(isCollectionTextNode);
>>>   rdfDescription.appendChild(isCollection);
>>> 
>>>   if (collection.getOwner() != null) {
>>>     Element owner = 
>>> 
>> rdfXmlContent.getDomNode().getOwnerDocument().createElementNS("http://
>>> www.ns
>>> dl.org/ontologies/relationships#", "owner");
>>>     Text ownerTextNode =
>>> 
>> rdfXmlContent.getDomNode().getOwnerDocument().createTextNode(c
>> ollection.getO
>>> wner());
>>>     owner.appendChild(ownerTextNode);
>>>     rdfDescription.appendChild(owner);
>>>   }
>>> 
>>>   rdfXmlContent.getDomNode().appendChild(rdfRoot);
>>> 
>>> 
>>> The prefix "myns" for element "myns:isCollection" is not bound
>>> 
>>> could anyone advise please?
>>> 
>>> thanks,
>>> 
>>> Alistair
>>> 
>>> --------------
>>> mov eax,1
>>> mov ebx,0
>>> int 80
>>> 
>>> 
>>> 
>> ----------------------------------------------------------------------
>>> ------
>>> --
>>> Got Input?   Slashdot Needs You.
>>> Take our quick survey online.  Come on, we don't ask for 
>> help often. Plus,
>>> you'll get a chance to win $100 to spend on ThinkGeek.
>>> http://p.sf.net/sfu/slashdot-survey
>>> _______________________________________________
>>> Fedora-commons-users mailing list 
>> Fedora-commons-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/fedora-commons-users
>>> 
>>> 
>>> 
>> --------------------------------------------------------------
>> ----------------
>>> Got Input?   Slashdot Needs You.
>>> Take our quick survey online.  Come on, we don't ask for 
>> help often. 
>>> Plus, you'll get a chance to win $100 to spend on ThinkGeek. 
>>> http://p.sf.net/sfu/slashdot-survey
>>> _______________________________________________
>>> Fedora-commons-users mailing list 
>>> Fedora-commons-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/fedora-commons-users
>> 
>> 
>> --------------------------------------------------------------
>> ----------------
>> Got Input?   Slashdot Needs You.
>> Take our quick survey online.  Come on, we don't ask for help 
>> often. Plus, you'll get a chance to win $100 to spend on 
>> ThinkGeek. http://p.sf.net/sfu/slashdot-survey
>> _______________________________________________
>> Fedora-commons-users mailing list 
>> Fedora-commons-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/fedora-commons-users
>> 
> 
> 
> ------------------------------------------------------------------------------
> Got Input?   Slashdot Needs You.
> Take our quick survey online.  Come on, we don't ask for help often.
> Plus, you'll get a chance to win $100 to spend on ThinkGeek.
> http://p.sf.net/sfu/slashdot-survey
> _______________________________________________
> Fedora-commons-users mailing list
> Fedora-commons-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fedora-commons-users


------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Fedora-commons-users mailing list
Fedora-commons-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users

Reply via email to