org.ontoware.rdf2go.model
Interface ReificationSupport

All Known Subinterfaces:
Model, ModelSet

public interface ReificationSupport

Support for reification, as defined in http://www.w3.org/TR/rdf-mt/#Reif

Author:
voelkel

Method Summary
 BlankNode addReificationOf(Statement statement)
          A convenience function for addReficationOf( createBlankNode(), statement );
 Resource addReificationOf(Statement statement, Resource resource)
          Reifies the statement, whether the statement was present in the model or not.
 void deleteReification(Resource reificationResource)
          Delete reifications made by this resource.
 java.util.Collection<Resource> getAllReificationsOf(Statement statement)
           
 boolean hasReifications(Statement stmt)
           
 

Method Detail

addReificationOf

BlankNode addReificationOf(Statement statement)
A convenience function for addReficationOf( createBlankNode(), statement );

Parameters:
statement -
Returns:
a new BlankNode which holds the reification of the given statement.

addReificationOf

Resource addReificationOf(Statement statement,
                          Resource resource)
Reifies the statement, whether the statement was present in the model or not. The statement itself is never added to the model, but it might have been in the model before this method call. This method creates only triples like (resource )rdf:subject s; rdf:predicate p; rdf:object o. Where s,p, and o are taken from the given statement. Adds the following statements, as defined in http://www.w3.org/TR/rdf-mt/#Reif
 (resource) rdf:type       rdf:Statement .
 (resource) rdf:subject   (statement.getSubject()) .
 (resource) rdf:predicate (statement.getPredicate()) .
 (resource) rdf:object    (statement.getObject()) .
 

Parameters:
statement - which will be reified
resource - used to represent the reified statement
Returns:
the given resource

deleteReification

void deleteReification(Resource reificationResource)
Delete reifications made by this resource. More technically, this method will remove the following patterns:
 (reificationResource) rdf:type      rdf:Statement . 
 (reificationResource) rdf:subject   * .
 (reificationResource) rdf:predicate * .
 (reificationResource) rdf:object    * .
 
Note that one resource might have been used in several reifications. Although semantic nonsense, this can happen. This method cleans up also these cases.

Parameters:
reificationResource -

getAllReificationsOf

java.util.Collection<Resource> getAllReificationsOf(Statement statement)
Parameters:
statement -
Returns:
a collection which contains all resources that are a reification of the given statement.

hasReifications

boolean hasReifications(Statement stmt)
Parameters:
stmt -
Returns:
true if the model contains results to the query
 ?reificationResource rdf:type      rdf:Statement . 
 ?reificationResource rdf:subject   ?s .
 ?reificationResource rdf:predicate ?p .
 ?reificationResource rdf:object    ?o .
 


Copyright © 2005-2008 FZI - Forschungszentrum Informatik | Karlsruhe | Germany. All Rights Reserved.