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.


Method Index

 o add(Resource, Resource, RDFnode)
Adds a new triple to the model.
 o add(Resource, Resource, String)
Adds a new triple to the model.
 o add(Triple)
Adds a new triple to the model.
 o contains(Triple)
Tests if the model contains the given triple.
 o create()
Creates empty model of the same Class
 o difference(Model)
Set difference with another model.
 o duplicate()
Clone the model.
 o elements()
Enumerate triples
 o find(Resource, Resource, RDFnode)
General method to search for triples.
 o find1(Resource, Resource, RDFnode)
Search for a single triple.
 o getURI()
Returns current base URI setting.
 o remove(Triple)
Removes the triple from the model.
 o setURI(String)
Set a base URI for the message.
 o size()
Number of triples in the model
 o union(Model)
Set union with another model.

Methods

 o 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

 o getURI
 public abstract String getURI()
Returns current base URI setting.

 o size
 public abstract int size()
Number of triples in the model

Returns:
number of triples
 o elements
 public abstract Enumeration elements()
Enumerate triples

 o 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
 o 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
 o 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
 o add
 public abstract void add(Triple t)
Adds a new triple to the model.

See Also:
Triple
 o remove
 public abstract void remove(Triple t)
Removes the triple from the model.

See Also:
Triple
 o 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
 o 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.
 o duplicate
 public abstract Model duplicate()
Clone the model.

 o create
 public abstract Model create()
Creates empty model of the same Class

 o union
 public abstract Model union(Model m)
Set union with another model.

Returns:
this, i.e. the model itself
 o 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