All Packages Class Hierarchy This Package Previous Next Index
Interface org.ginf.Model
- public interface Model
This is a programming interface to an RDF model.
An RDF model is a directed labeled graph.
This interface represents a model as set of triples.
Every triple has a subject, a predicate and an object.
-
add(Resource, Resource, RDFnode)
- Adds a new triple to the model.
-
add(Resource, Resource, String)
- Adds a new triple to the model.
-
add(Triple)
- Adds a new triple to the model.
-
contains(Triple)
- Tests if the model contains the given triple.
-
create()
- Creates empty model of the same Class
-
difference(Model)
- Set difference with another model.
-
duplicate()
- Clone the model.
-
elements()
- Enumerate triples
-
find(Resource, Resource, RDFnode)
- General method to search for triples.
-
find1(Resource, Resource, RDFnode)
- Search for a single triple.
-
getURI()
- Returns current base URI setting.
-
remove(Triple)
- Removes the triple from the model.
-
setURI(String)
- Set a base URI for the message.
-
size()
- Number of triples in the model
-
union(Model)
- Set union with another model.
setURI
public abstract void setURI(String uri)
- Set a base URI for the message.
Affects creating of new resources and serialization syntax.
null
is just alright, meaning that
the serializer will use always rdf:about and never rdf:ID
getURI
public abstract String getURI()
- Returns current base URI setting.
size
public abstract int size()
- Number of triples in the model
- Returns:
- number of triples
elements
public abstract Enumeration elements()
- Enumerate triples
contains
public abstract boolean contains(Triple t)
- Tests if the model contains the given triple.
- Returns:
-
true
if the triple belongs to the model;
false
otherwise.
- See Also:
- Triple
add
public abstract void add(Resource subject,
Resource predicate,
String object)
- Adds a new triple to the model. A literal is created out of the string parameter
object
.
This method is just a shortcut.
- See Also:
- Resource
add
public abstract void add(Resource subject,
Resource predicate,
RDFnode object)
- Adds a new triple to the model. The object of the triple is an RDFnode.
- See Also:
- Resource, RDFnode
add
public abstract void add(Triple t)
- Adds a new triple to the model.
- See Also:
- Triple
remove
public abstract void remove(Triple t)
- Removes the triple from the model.
- See Also:
- Triple
find
public abstract Model find(Resource subject,
Resource predicate,
RDFnode object)
- General method to search for triples.
null
input for any parameter will match anything.
Example: Model result = m.find( null, RDF.type, new Resource("http://...#MyClass") )
finds all instances of the class MyClass
- See Also:
- Resource, RDFnode
find1
public abstract Triple find1(Resource subject,
Resource predicate,
RDFnode object)
- Search for a single triple.
null
input for any parameter will match anything.
- Returns:
- a single triple if such was found;
null
if nothing was found;
otherwise a RuntimeException is thrown.
duplicate
public abstract Model duplicate()
- Clone the model.
create
public abstract Model create()
- Creates empty model of the same Class
union
public abstract Model union(Model m)
- Set union with another model.
- Returns:
-
this
, i.e. the model itself
difference
public abstract Model difference(Model m)
- Set difference with another model.
- Returns:
-
this
, i.e. the model itself
All Packages Class Hierarchy This Package Previous Next Index