|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.w3c.rdf.util.RDFUtil
Useful utility methods.
Constructor Summary | |
RDFUtil()
|
Method Summary | |
static void |
add(Model m,
Resource subject,
Resource predicate,
RDFNode object)
|
static void |
collectNamespaces(Model m,
java.util.Collection target)
|
static void |
collectNamespaces(Resource r,
java.util.Collection target)
|
static void |
collectNamespaces(Statement st,
java.util.Collection target)
|
static void |
dumpModel(Model m,
java.io.PrintStream ps,
RDFSerializer s)
Dumps the model in a serialized form. |
static java.lang.String |
dumpModel(Model m,
RDFSerializer s)
Dumps the model in a serialized form in a string |
static Statement |
get1(Model m)
Returns the first triple of the model |
static java.lang.String |
getLocalName(Resource r)
Delivers the name out of the URI (without the namespace prefix). |
static java.lang.String |
getNamespace(Resource r)
Extracts the namespace prefix out of a URI. |
static java.util.Hashtable |
getNodes(Model m)
|
static RDFNode |
getObject(Model r,
Resource subject,
Resource predicate)
|
static java.lang.String |
getObjectLiteral(Model r,
Resource subject,
Resource predicate)
returns the literal value of the node reachable from subject via predicate |
static Resource |
getObjectResource(Model r,
Resource subject,
Resource predicate)
|
static int |
getOrd(Resource r)
Converts an ordinal property to an integer. |
static Model |
getReachable(Resource r,
Model m)
returns a subgraph of "m" containing "r" and all nodes reachable from "r" via directed edges. |
static java.util.Hashtable |
getResources(Model m)
|
static Statement[] |
getStatementArray(Model m)
Collects the triples of a model into an array. |
static java.util.Vector |
getStatementVector(Model m)
Collects the triples of a model in a vector. |
static Resource |
getSubject(Model r,
Resource predicate,
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 boolean |
isInstanceOf(Model r,
Resource i,
Resource cls)
|
static boolean |
isQualified(java.lang.String s)
Tests if the URI is qualified, i.e. |
static boolean |
isRDF(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 Resource |
noname(Model m)
Creates a new unique unnamed resource. |
static java.lang.String |
normalizeURI(java.lang.String uri)
|
static void |
parse(java.lang.String fileNameOrURL,
RDFParser parser,
Model model)
|
static void |
printStatements(Model m,
java.io.PrintStream ps)
Prints the triples of a model to the given PrintStream. |
static Model |
removeNamespace(java.lang.String ns,
Model m)
Removes all triples which have something to do with the given namespace |
static void |
saveModel(Model m,
RDFSerializer s)
tries to determine the file name from getSourceURI |
static void |
saveModel(Model m,
java.lang.String fileName,
RDFSerializer s)
|
static boolean |
setUniqueObject(Model r,
Resource subject,
Resource predicate,
RDFNode object)
returns true if old triples from r were removed |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RDFUtil()
Method Detail |
public static Resource noname(Model m) throws ModelException
public static int getOrd(Resource r) throws 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(Resource r) throws ModelException
public static java.lang.String getLocalName(Resource r) throws ModelException
public static boolean isRDF(java.lang.String uri)
public static boolean isRDF(Resource r) throws ModelException
public static Statement get1(Model m) throws ModelException
public static void add(Model m, Resource subject, Resource predicate, RDFNode object) throws ModelException
public static boolean setUniqueObject(Model r, Resource subject, Resource predicate, RDFNode object) throws ModelException
public static java.lang.String getObjectLiteral(Model r, Resource subject, Resource predicate) throws ModelException
public static Resource getObjectResource(Model r, Resource subject, Resource predicate) throws ModelException
public static boolean isInstanceOf(Model r, Resource i, Resource cls) throws ModelException
public static RDFNode getObject(Model r, Resource subject, Resource predicate) throws ModelException
public static Resource getSubject(Model r, Resource predicate, RDFNode object) throws ModelException
public static void printStatements(Model m, java.io.PrintStream ps) throws ModelException
public static void dumpModel(Model m, java.io.PrintStream ps, RDFSerializer s) throws ModelException, java.io.IOException, SerializationException
public static java.lang.String dumpModel(Model m, RDFSerializer s) throws ModelException, java.io.IOException, SerializationException
public static java.util.Vector getStatementVector(Model m) throws ModelException
public static Statement[] getStatementArray(Model m) throws ModelException
public static Model removeNamespace(java.lang.String ns, Model m) throws ModelException
public static Model getReachable(Resource r, Model m) throws ModelException
public static void parse(java.lang.String fileNameOrURL, RDFParser parser, Model model) throws java.io.IOException, SAXException, java.net.MalformedURLException, ModelException
public static java.lang.String normalizeURI(java.lang.String uri)
public static java.util.Hashtable getResources(Model m) throws ModelException
public static java.util.Hashtable getNodes(Model m) throws ModelException
public static void saveModel(Model m, java.lang.String fileName, RDFSerializer s) throws java.io.FileNotFoundException, java.io.IOException, ModelException, SerializationException
public static void saveModel(Model m, RDFSerializer s) throws java.io.FileNotFoundException, java.io.IOException, ModelException, SerializationException
public static void collectNamespaces(Resource r, java.util.Collection target) throws ModelException
public static void collectNamespaces(Statement st, java.util.Collection target) throws ModelException
public static void collectNamespaces(Model m, java.util.Collection target) throws ModelException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |