|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--dfki.util.rdf.RDF
Class to support RDF handling.
Main entry points are the two methods for creating an RDFFactory
.
These are factory()
and factory(String)
. New models, RDF parsers and
RDF serializers can be created via this factory class.
The RDF class also provides a number of static convenience methods that
make life with RDF a little bit easier.
A speacial RDF.Syntax
class offers standard resource instances
for given namespaces. These instances can be useful for search and
compare operations on the triples of a model. The Syntax
instance
can be obtained via the methods syntax()
and
syntax(String)
.
Properties of the RDF
class are:
Util.RDF.RDFFactoryImplClassName
)RDFFactory
interfaceUtil.RDF.DefaultSyntaxNamespace
)dfki.util.examples.rdf
to see how to use
the RDF
class.
Inner Class Summary | |
static class |
RDF.Exception
|
static class |
RDF.Import
|
static class |
RDF.Property
Defines the Properties of the RDF class. |
static class |
RDF.Setup
Class managing the Setup of the RDF class. |
static class |
RDF.Syntax
|
Field Summary | |
static java.lang.String |
DEFAULT_IMPORT_IMPL_CLASSNAME
|
static java.lang.String |
DEFAULT_RDF_FACTORY_CLASSNAME
|
static java.lang.String |
DEFAULT_SYNTAX_NAMESPACE
|
static java.lang.String |
MODULE_NAME
|
Method Summary | |
static void |
add(org.w3c.rdf.model.Model m,
org.w3c.rdf.model.Resource subject,
org.w3c.rdf.model.Resource predicate,
org.w3c.rdf.model.RDFNode object)
|
static void |
collectNamespaces(org.w3c.rdf.model.Model m,
java.util.Collection target)
|
static void |
collectNamespaces(org.w3c.rdf.model.Resource r,
java.util.Collection target)
|
static void |
collectNamespaces(org.w3c.rdf.model.Statement st,
java.util.Collection target)
|
static void |
dumpModel(org.w3c.rdf.model.Model m,
java.io.PrintStream ps,
org.w3c.rdf.syntax.RDFSerializer s)
Dumps the model in a serialized form. |
static java.lang.String |
dumpModel(org.w3c.rdf.model.Model m,
org.w3c.rdf.syntax.RDFSerializer s)
Dumps the model in a serialized form in a string |
static java.lang.String |
dumpModel(org.w3c.rdf.model.Model m,
java.io.Writer w,
org.w3c.rdf.syntax.RDFSerializer s)
Dumps the model in a serialized form in a string |
static org.w3c.rdf.util.RDFFactory |
factory()
Create a RDFFactory. |
static org.w3c.rdf.util.RDFFactory |
factory(java.lang.String factoryImplClassName)
Create a RDFFactory. |
static org.w3c.rdf.model.Statement |
get1(org.w3c.rdf.model.Model m)
Returns the first triple of the model |
static java.lang.String |
getLocalName(org.w3c.rdf.model.Resource r)
Delivers the name out of the URI (without the namespace prefix). |
static java.lang.String |
getNamespace(org.w3c.rdf.model.Resource r)
Extracts the namespace prefix out of a URI. |
static java.util.Hashtable |
getNodes(org.w3c.rdf.model.Model m)
|
static org.w3c.rdf.model.RDFNode |
getObject(org.w3c.rdf.model.Model r,
org.w3c.rdf.model.Resource subject,
org.w3c.rdf.model.Resource predicate)
|
static java.lang.String |
getObjectLiteral(org.w3c.rdf.model.Model r,
org.w3c.rdf.model.Resource subject,
org.w3c.rdf.model.Resource predicate)
returns the literal value of the node reachable from subject via predicate |
static org.w3c.rdf.model.Resource |
getObjectResource(org.w3c.rdf.model.Model r,
org.w3c.rdf.model.Resource subject,
org.w3c.rdf.model.Resource predicate)
|
static int |
getOrd(org.w3c.rdf.model.Resource r)
Converts an ordinal property to an integer. |
static org.w3c.rdf.model.Model |
getReachable(org.w3c.rdf.model.Resource r,
org.w3c.rdf.model.Model m)
returns a subgraph of "m" containing "r" and all nodes reachable from "r" via directed edges. |
static java.util.Hashtable |
getResources(org.w3c.rdf.model.Model m)
|
static org.w3c.rdf.model.Statement[] |
getStatementArray(org.w3c.rdf.model.Model m)
Collects the triples of a model into an array. |
static java.util.Vector |
getStatementVector(org.w3c.rdf.model.Model m)
Collects the triples of a model in a vector. |
static org.w3c.rdf.model.Resource |
getSubject(org.w3c.rdf.model.Model r,
org.w3c.rdf.model.Resource predicate,
org.w3c.rdf.model.RDFNode object)
|
static java.lang.String |
guessName(java.lang.String uri)
Delivers the name out of the URI (without the namespace prefix). |
static java.lang.String |
guessNamespace(java.lang.String uri)
Extracts the namespace prefix out of a URI. |
static RDF.Import |
importer(java.lang.String namespace,
java.lang.String packageName)
|
static RDF.Import |
importer(java.lang.String importerImplClassName,
java.lang.String namespace,
java.lang.String packageName)
|
static boolean |
isInstanceOf(org.w3c.rdf.model.Model r,
org.w3c.rdf.model.Resource i,
org.w3c.rdf.model.Resource cls)
|
static boolean |
isQualified(java.lang.String s)
Tests if the URI is qualified, i.e. |
static boolean |
isRDF(org.w3c.rdf.model.Resource r)
Tests if the resource belongs to the RDF syntax/model namespace. |
static boolean |
isRDF(java.lang.String uri)
Tests if the URI belongs to the RDF syntax/model namespace. |
static org.w3c.rdf.model.Resource |
noname(org.w3c.rdf.model.Model m)
Creates a new unique unnamed resource. |
static java.lang.String |
normalizeURI(java.lang.String uri)
|
static void |
parse(java.lang.String fileNameOrURL,
org.w3c.rdf.syntax.RDFParser parser,
org.w3c.rdf.model.Model model)
|
static void |
parse(java.lang.String uri,
java.io.Reader reader,
org.w3c.rdf.util.RDFFactory factory)
|
static void |
parse(java.lang.String uri,
java.io.Reader reader,
org.w3c.rdf.syntax.RDFParser parser,
org.w3c.rdf.model.Model model)
|
static void |
printStatements(org.w3c.rdf.model.Model m,
java.io.PrintStream ps)
Prints the triples of a model to the given PrintStream. |
static org.w3c.rdf.model.Model |
removeNamespace(java.lang.String ns,
org.w3c.rdf.model.Model m)
Removes all triples which have something to do with the given namespace |
static void |
saveModel(org.w3c.rdf.model.Model m,
org.w3c.rdf.syntax.RDFSerializer s)
tries to determine the file name from getSourceURI |
static void |
saveModel(org.w3c.rdf.model.Model m,
java.lang.String fileName,
org.w3c.rdf.syntax.RDFSerializer s)
|
static boolean |
setUniqueObject(org.w3c.rdf.model.Model r,
org.w3c.rdf.model.Resource subject,
org.w3c.rdf.model.Resource predicate,
org.w3c.rdf.model.RDFNode object)
returns true if old triples from r were removed |
static RDF.Syntax |
syntax()
|
static RDF.Syntax |
syntax(java.lang.String namespace)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String MODULE_NAME
public static final java.lang.String DEFAULT_RDF_FACTORY_CLASSNAME
public static final java.lang.String DEFAULT_SYNTAX_NAMESPACE
public static final java.lang.String DEFAULT_IMPORT_IMPL_CLASSNAME
Method Detail |
public static RDF.Syntax syntax() throws RDF.Exception
public static RDF.Syntax syntax(java.lang.String namespace) throws RDF.Exception
public static org.w3c.rdf.util.RDFFactory factory() throws RDF.Exception
RDF.Property.RDF_FACTORY_IMPL_CLASSNAME
public static org.w3c.rdf.util.RDFFactory factory(java.lang.String factoryImplClassName) throws RDF.Exception
factoryImplClassName
- The class name of a RDFFactory implementation.public static RDF.Import importer(java.lang.String namespace, java.lang.String packageName) throws RDF.Import.Exception
public static RDF.Import importer(java.lang.String importerImplClassName, java.lang.String namespace, java.lang.String packageName) throws RDF.Import.Exception
public static void parse(java.lang.String uri, java.io.Reader reader, org.w3c.rdf.syntax.RDFParser parser, org.w3c.rdf.model.Model model) throws java.io.IOException, org.xml.sax.SAXException, org.w3c.rdf.model.ModelException
public static void parse(java.lang.String uri, java.io.Reader reader, org.w3c.rdf.util.RDFFactory factory) throws java.io.IOException, org.xml.sax.SAXException, org.w3c.rdf.model.ModelException
public static org.w3c.rdf.model.Resource noname(org.w3c.rdf.model.Model m) throws org.w3c.rdf.model.ModelException
public static int getOrd(org.w3c.rdf.model.Resource r) throws org.w3c.rdf.model.ModelException
public static boolean isQualified(java.lang.String s)
public static java.lang.String guessNamespace(java.lang.String uri)
public static java.lang.String guessName(java.lang.String uri)
public static java.lang.String getNamespace(org.w3c.rdf.model.Resource r) throws org.w3c.rdf.model.ModelException
public static java.lang.String getLocalName(org.w3c.rdf.model.Resource r) throws org.w3c.rdf.model.ModelException
public static boolean isRDF(java.lang.String uri)
public static boolean isRDF(org.w3c.rdf.model.Resource r) throws org.w3c.rdf.model.ModelException
public static org.w3c.rdf.model.Statement get1(org.w3c.rdf.model.Model m) throws org.w3c.rdf.model.ModelException
public static void add(org.w3c.rdf.model.Model m, org.w3c.rdf.model.Resource subject, org.w3c.rdf.model.Resource predicate, org.w3c.rdf.model.RDFNode object) throws org.w3c.rdf.model.ModelException
public static boolean setUniqueObject(org.w3c.rdf.model.Model r, org.w3c.rdf.model.Resource subject, org.w3c.rdf.model.Resource predicate, org.w3c.rdf.model.RDFNode object) throws org.w3c.rdf.model.ModelException
public static java.lang.String getObjectLiteral(org.w3c.rdf.model.Model r, org.w3c.rdf.model.Resource subject, org.w3c.rdf.model.Resource predicate) throws org.w3c.rdf.model.ModelException
public static org.w3c.rdf.model.Resource getObjectResource(org.w3c.rdf.model.Model r, org.w3c.rdf.model.Resource subject, org.w3c.rdf.model.Resource predicate) throws org.w3c.rdf.model.ModelException
public static boolean isInstanceOf(org.w3c.rdf.model.Model r, org.w3c.rdf.model.Resource i, org.w3c.rdf.model.Resource cls) throws org.w3c.rdf.model.ModelException
public static org.w3c.rdf.model.RDFNode getObject(org.w3c.rdf.model.Model r, org.w3c.rdf.model.Resource subject, org.w3c.rdf.model.Resource predicate) throws org.w3c.rdf.model.ModelException
public static org.w3c.rdf.model.Resource getSubject(org.w3c.rdf.model.Model r, org.w3c.rdf.model.Resource predicate, org.w3c.rdf.model.RDFNode object) throws org.w3c.rdf.model.ModelException
public static void printStatements(org.w3c.rdf.model.Model m, java.io.PrintStream ps) throws org.w3c.rdf.model.ModelException
public static void dumpModel(org.w3c.rdf.model.Model m, java.io.PrintStream ps, org.w3c.rdf.syntax.RDFSerializer s) throws org.w3c.rdf.model.ModelException, java.io.IOException, org.w3c.rdf.syntax.SerializationException
public static java.lang.String dumpModel(org.w3c.rdf.model.Model m, org.w3c.rdf.syntax.RDFSerializer s) throws org.w3c.rdf.model.ModelException, java.io.IOException, org.w3c.rdf.syntax.SerializationException
public static java.lang.String dumpModel(org.w3c.rdf.model.Model m, java.io.Writer w, org.w3c.rdf.syntax.RDFSerializer s) throws org.w3c.rdf.model.ModelException, java.io.IOException, org.w3c.rdf.syntax.SerializationException
public static java.util.Vector getStatementVector(org.w3c.rdf.model.Model m) throws org.w3c.rdf.model.ModelException
public static org.w3c.rdf.model.Statement[] getStatementArray(org.w3c.rdf.model.Model m) throws org.w3c.rdf.model.ModelException
public static org.w3c.rdf.model.Model removeNamespace(java.lang.String ns, org.w3c.rdf.model.Model m) throws org.w3c.rdf.model.ModelException
public static org.w3c.rdf.model.Model getReachable(org.w3c.rdf.model.Resource r, org.w3c.rdf.model.Model m) throws org.w3c.rdf.model.ModelException
public static void parse(java.lang.String fileNameOrURL, org.w3c.rdf.syntax.RDFParser parser, org.w3c.rdf.model.Model model) throws java.io.IOException, org.xml.sax.SAXException, java.net.MalformedURLException, org.w3c.rdf.model.ModelException
public static java.lang.String normalizeURI(java.lang.String uri)
public static java.util.Hashtable getResources(org.w3c.rdf.model.Model m) throws org.w3c.rdf.model.ModelException
public static java.util.Hashtable getNodes(org.w3c.rdf.model.Model m) throws org.w3c.rdf.model.ModelException
public static void saveModel(org.w3c.rdf.model.Model m, java.lang.String fileName, org.w3c.rdf.syntax.RDFSerializer s) throws java.io.FileNotFoundException, java.io.IOException, org.w3c.rdf.model.ModelException, org.w3c.rdf.syntax.SerializationException
public static void saveModel(org.w3c.rdf.model.Model m, org.w3c.rdf.syntax.RDFSerializer s) throws java.io.FileNotFoundException, java.io.IOException, org.w3c.rdf.model.ModelException, org.w3c.rdf.syntax.SerializationException
public static void collectNamespaces(org.w3c.rdf.model.Resource r, java.util.Collection target) throws org.w3c.rdf.model.ModelException
public static void collectNamespaces(org.w3c.rdf.model.Statement st, java.util.Collection target) throws org.w3c.rdf.model.ModelException
public static void collectNamespaces(org.w3c.rdf.model.Model m, java.util.Collection target) throws org.w3c.rdf.model.ModelException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |