Hi Vincent
 
You'd have to supply the parameters subject, predicate and object (and in
this case state that the object is a literal).
 
The parameters will need to be URL-encoded for the REST API.
 
You don't have to define your own schema, though you should use your own
namespace (and of course it is good practice to define a schema and make it
available).
 
So in this case you'd use the values:
 
subject=uri of the object (ie info:fedora/demo:123)
predicate=http://your-relationships-domain/fedoraRels#isFeatured
object=true
isLiteral=true
 
URL encode the parameters, and pass them in as per the REST API
documentation.
 
Optionally you could define the datatype of the object (it will default to a
string, but you could for instance use boolean, I see you are using string
in your example).
 
Note that I have "made up" a namespace for your relationship -
http://your-relationships-domain/fedoraRels#.  this is equivalent to
writing, in XML:
 
.....
<ns:isFeatured
xmlns:ns="http://your-relationships-domain/fedoraRels#";>true</ns:isFeatured>
......
 
It's entirely up to you what to use as a namespace - but use something that
you "own".
 
Regards
Steve

-----Original Message-----
From: Nguyen, Vincent (CDC/OD/OADS) (CTR) [mailto:v...@cdc.gov] 
Sent: 02 February 2011 14:15
To: Support and info exchange list for Fedora users.
Subject: Re: [fcrepo-user] Modify RDF content



If I were to use the addRelationship method, what would be the parameters
that I pass?  I want to modify an existing RELS-EXT datastream to get this
result

 

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
xmlns:rel="info:fedora/fedora-system:def/relations-external#">

            <rdf:Description rdf:about="info:fedora/demo:123">

                        <rel:isCollection>true</rel:isCollection>

                        <isFeatured>true</isFeatured>

            </rdf:Description>

</rdf:RDF>

 

Adding a custom relationship description "<isFeatured>true</isFeatured>"

 

Will I have to write my own relationship schema in order to use the
addRelationship (xmsns:myRel="myRel.xml")?

 

If not, I think I should be able to use the getDatastreamDissemination 

 

Thanks

 

Vincent Vu Nguyen



 

From: Steve Bayliss [mailto:stephen.bayl...@acuityunlimited.net] 
Sent: Wednesday, February 02, 2011 2:45 AM
To: 'Support and info exchange list for Fedora users.'
Subject: Re: [fcrepo-user] Modify RDF content

 

Hi Vincent

 

There are two methods to update relationships using API-M

 

The easiest is probably to use the relationships methods - see:

 

https://wiki.duraspace.org/display/FCR30/API-M#API-M-RelationshipManagement
and the corresponding methods in the REST API at
https://wiki.duraspace.org/display/FCR30/REST+API#RESTAPI-APIMMethods

 

The second is as you suggest - read the RDF directly (eg API-A
getDatastreamDissemination) , modify it in your application, and then update
RELS-EXT with the updated version (eg the API-M modifyDatastream methods).

 

Full documentation on the REST and SOAP APIs is at:

SOAP: https://wiki.duraspace.org/display/FCR30/API-A and
https://wiki.duraspace.org/display/FCR30/API-M

REST: https://wiki.duraspace.org/display/FCR30/REST+API

 

Regards

Steve

 

-----Original Message-----
From: Nguyen, Vincent (CDC/OD/OADS) (CTR) [mailto:v...@cdc.gov] 
Sent: 02 February 2011 06:05
To: fedora-commons-users@lists.sourceforge.net
Subject: [fcrepo-user] Modify RDF content

Hi,

 

Currently I add a custom node (isFeatured) in the RELS-EXT Datastream to
grab objects I want to feature in my repository.  I didn't really know any
other way to do this so I used the RELS-EXT Datastream.  I want to modify
RDF Datastream to add this custom node using Fedora APIM.  Is there a way to
do this?  Or is there a way to read the RDF Datastream as an XML and add a
node and then "re-add" the datastream?  Please let me know if there's a
better way to achieve this functionality.  

 

Pardon any ignorant questions I may ask, as I'm still a Newbie.

 

Vincent Vu Nguyen

 

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Fedora-commons-users mailing list
Fedora-commons-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users

Reply via email to