Update API specification
RDF Suite RSSDB RDF Update API Download UpdateAPI Installation API specification Usage Error Handling
| int | create_instance (text *resourceURI, text *classNS, text *className) |
| int | delete_object (text *resourceURI, text *classNS, text *className, int extended) |
| int | add_property (text *propertyNS, text *propertyName, text *source, text *target) |
| int | update_property (text *propertyNS, text *propertyName, text *source, text *old_target, text *target, int extended) |
| int | delete_property (text *propertyNS, text *propertyName, text *source, text *target, int extended) |

| Fig. 1. Example: Schema box: Artist, artifact, painter and painting are classes. The blue lines imply subclass relations. For example, painter is a subclass of artist. The green lines imply property relations. For example, there is a property paints with domain painter and range painting. Data box: red lines indicate that something is an instance of a class. For example, #picasso is an instance of painter. Black lines with green titles on them indicate a property instance (also called a property link). For example, a paints instance connects #picasso with #guernica. |
![]() Fig. 2. Create a new title for #guernica. New title will be "Guernica". |
||||||||||||||||||||||||
| <>Adds a property link to a resource. In the example,
a new
property is added (yellow lines). The method call for this update is add_property('',
'title', '#guernica', 'Guernica') which creates a new property title. In the example, the target is
a literal. If the target is another class instance, that instance must
exist, otherwise the property link is not added. It is not allowed to add a property link to a parent class of the source. For example, we cannot insert a title to an object that is directly instaciated as artifact. On the other hand, subclasses inherit the properties of their ancestors. For example, any painter object can have a property that is declared as artist->property->value. Adding an existing property is not allowed, but we can insert
a new property links of the same type with the same source or the same target/value. For
example, we can insert the #picasso->nane->Pablo link, but we
cannot insert the #picasso->name->Picasso link if it exists
allready. What's more, we can insert the #davinci->name->Picasso
link, as long as #davinci is a painter.
|
![]() Fig. 3. Create a new artist instance, named #davinci. |
||||||||||||||||
|
Classify a resource in a class. In the example, a new resource
#davinci is classified as
artist. The method call
that creates the new resource is create_instance('#davinci', '', 'artist') .
In the example, davinci is not a painter, therefore
we cannot add the name and paints properties on it.
|
![]() Fig. 4. Deletion of the instantion link between painting and #guernica or artifact and #guernica. |
||||||||||||||||||||||||
|
This method deletes the instantiation link between the
resourceURI and the className. In fact, the following links and objects
are deleted:
- The ingoing and outgoing property links of the resource that are are valid because the resource is classified in the 'classNS + className' class. For example, the link #picasso paints #guernica wil be deleted, because the range of paints is painting. - The resource may also be deleted if and
only if the 'classNS+className' is the only class in which the resource
is classified. In the example, #guernica
will be deleted. If #guernica
was also directly classified as artifact,
the instatiation link wouldn't be deleted. delete_object can be used to delete instances from a higher
class level. For example, delete object could be called as delete_object('#guernica', '', 'artifact',
0). In that case, all of the above deletions would occur,
allthough #guernica is
classified as painting,
because painting is a
subclass of artifact.
|
![]() Fig. 5. Delete two property links. The first is #picasso name "Picasso". The second is #picasso paints #guernica. |
||||||||||||||||||||||||
|
Deletes a property link from a resource. If the property range
is literal, the property value is also deleted. Otherwise, the target
object stays intact. For example, delete_property('',
'name', '#picasso', 'Picasso', 1) will delete the
property link between #picasso
and the name value. It will
also delete the value itself. On the contrary, delete_property('', 'title', '#picasso',
'#guernica', 1) will delete the property link (title) but not the target object (#guernica), as shown in Fig. 5
|
![]() Fig. 6. Update property link #picasso name 'Picasso' to 'Pablo Picasso'. |
||||||||||||||||||||||||||||||||
|
Replaces the old value of a property link of a resource with a
new value. If this value is a literal, then it is changed, and the old
value is deleted, as shown in Fig. 6. Otherwise, the property link is
set to connect the source resource to antoher valid target resource,
whithout deleting the old target resource.
|