addRelationship
Creates a new relationship in the object. Adds the specified relationship to the object's RELS-EXT or RELS-INT Datastream. If the Resource Index is enabled, the relationship will be added to the Resource Index.
A rdf tuple consist of an object or datastream (the subject), having a predicate relating it to a target (the object). The object can either be a literal value, or a URI (which can identify for example a Fedora object or a datastream).
Input parameters:
• String subject The subject. Either a Fedora object URI (eg info:fedora/demo:333) or a datastream URI (eg info:fedora/demo:333/DS1).
• String relationship The predicate.
• String object The object (target).
• boolean isLiteral A boolean value indicating whether the object is a literal.
• String datatype The datatype of the literal. Optional.
Returns:
• boolean True if and only if the relationship was added.
getRelationships
Get the relationships asserted in the object's RELS-EXT or RELS-INT Datastream that match the given criteria.
Input parameters:
• String subject The subject. Either a Fedora object URI (eg info:fedora/demo:333) or a datastream URI (eg info:fedora/demo:333/DS1).
• String relationship The predicate to match. A null value matches all predicates.
Returns:
• RelationshipTuple[]** String subject - The subject of the relation. Either a Fedora object URI (eg info:fedora/demo:333) or a datastream URI (eg info:fedora/demo:333/DS1).
• String predicate - The predicate relating the subject and the object. Includes the namespace of the relation.
• String object - The URI of the object (target) of the relation
• boolean isLiteral - If true, the subject should be read as a literal value, not a URI
• String datatype - If the subject is a literal, the datatype to parse the value as. Optional.
purgeRelationship
Delete the specified relationship. This method will remove the specified relationship(s) from the RELS-EXT or RELS-INT datastream. If the Resource Index is enabled, this will also delete the corresponding triples from the Resource Index.
Input parameters:
• String subject The subject. Either a Fedora object URI (eg info:fedora/demo:333) or a datastream URI (eg info:fedora/demo:333/DS1).
• String relationship The predicate, null matches any predicate.
• String object The object, null matches any object.
• boolean isLiteral A boolean value indicating whether the object is a literal.
• String datatype The datatype of the literal. Optional.
Returns:
• boolean True if and only if the relationship was purged.
Extracted from here