|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectse.kmr.scam.rdf.util.RDFUtil
Helper for RDF-operations.
NA means Non-Anonymous.
LI mean RDF.li stuff
Title:
Description:
Copyright: Copyright (c) 2002
Company:
| Field Summary | |
protected static org.apache.log4j.Category |
LOG
Log4j-logger |
| Constructor Summary | |
RDFUtil()
|
|
| Method Summary | |
static RDFNode |
getObject(Model m,
RDFNode node)
Fetch an RDF-Object |
static RDFNode |
getObject(Model m,
Resource res,
Property prop)
Fetch an RDF-Object |
static Resource |
getResource(Model m,
Property predicate,
RDFNode object)
Fetch a resource by predicate and object. |
static Resource |
getResource(Model m,
Resource res)
Fetch a Resource. |
static Resource |
getRoot(Model m)
Fetch the "root" of a Model. |
static Resource |
getRoot(Model m,
Resource res)
Backtrack to retrieve the NA-resource having res. |
static boolean |
hasObject(Model m,
RDFNode node)
Check existance of an RDF-Object. |
static boolean |
hasResource(Model m,
Resource res)
Check existance of a Resource. |
static boolean |
isAnon(Resource res)
Test if a Resource is anonymous. |
static boolean |
isEmpty(Model m)
Check if model is empty (contains no statements) |
static boolean |
isFakeAnon(Resource res)
|
static List |
listAnonymous(Model m)
List all anonymous subjects. |
static List |
listLIObjects(Model m,
Resource res)
List ALL the (RDF.li) objects of a container-Resource. |
static List |
listLIObjects(Model m,
Resource res,
boolean onlyResources)
List the objects (RDF.li-resources) of a container-Resource. |
static List |
listNASubjects(Model m)
List all non-anonymous subjects. |
static List |
listNASubjects(Model m,
Property predicate,
RDFNode object)
List all non-anonymous subjects. |
static List |
listNonLIObjects(Model m,
Resource res)
List ALL the non-RDF.li-objects. |
static List |
listNonLIObjects(Model m,
Resource res,
boolean onlyResources)
List the non-(RDF.li) objects. |
static List |
listObjects(Model m,
Resource subject,
Property predicate)
List ALL the objects. |
static List |
listObjects(Model m,
Resource subject,
Property predicate,
boolean onlyResources)
List the objects. |
static void |
main(String[] args)
|
static void |
remove(Model m,
Statement stm)
Remove a statement from a model. |
static void |
replace(Model m,
RDFNode orig,
RDFNode node)
Replace ALL occurences of orig with node.
|
static void |
replace(Model m,
Resource subj,
Property pred,
RDFNode obj)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static org.apache.log4j.Category LOG
| Constructor Detail |
public RDFUtil()
| Method Detail |
public static boolean hasResource(Model m,
Resource res)
throws RDFException
m - Modelres - Resource
true if found
RDFException - Description of the Exception
public static Resource getResource(Model m,
Resource res)
throws RDFException
m - Modelres - Description of the Parameter
Resource or null if not found
RDFException - Description of the Exception
public static Resource getResource(Model m,
Property predicate,
RDFNode object)
throws RDFException
m - Modelpredicate - Predicateobject - Object
Resource or null if not found
RDFException
public static void remove(Model m,
Statement stm)
throws RDFException
m - Modelstm - Statement
RDFException
public static boolean hasObject(Model m,
RDFNode node)
throws RDFException
m - Modelnode - Object
true if found
RDFException - Description of the Exception
public static RDFNode getObject(Model m,
RDFNode node)
throws RDFException
m - Modelnode - Object to fetch
null if not found
RDFException
public static RDFNode getObject(Model m,
Resource res,
Property prop)
throws RDFException
m - Modelres - Subjectprop - Property
null if not found
RDFException
public static Resource getRoot(Model m)
throws RDFException
m - Model
null if not found
RDFException
public static Resource getRoot(Model m,
Resource res)
throws RDFException
m - Modelres - Resource
null if none
RDFException
public static List listObjects(Model m,
Resource subject,
Property predicate,
boolean onlyResources)
throws RDFException
subject and/or predicate
can be null
m - Modelsubject - Subjectpredicate - PredicateonlyResources - Select only objects of type Resource
Collection of RDFNodes
RDFException
public static List listObjects(Model m,
Resource subject,
Property predicate)
throws RDFException
subject and/or predicate
can be null
m - Modelsubject - Subjectpredicate - Predicate
Collection of RDFNodes
RDFExceptionlistObjects(Model, Resource, Property, boolean)
public static List listLIObjects(Model m,
Resource res,
boolean onlyResources)
throws RDFException
m - Modelres - Resource (parent)onlyResources - Select only objects of type Resource
Collection of RDFNodes
RDFException - Description of the Exception
public static List listLIObjects(Model m,
Resource res)
throws RDFException
m - Modelres - Resource
Collection of RDFNodes
RDFExceptionlistLIObjects(Model, Resource, boolean)
public static List listNonLIObjects(Model m,
Resource res,
boolean onlyResources)
throws RDFException
m - Modelres - ResourceonlyResources - Select only objects of type Resource
Collection of RDFNodes
RDFException
public static List listNonLIObjects(Model m,
Resource res)
throws RDFException
m - Modelres - Resource
Collection of RDFNodes
RDFExceptionlistNonLIObjects(Model, Resource, boolean)
public static List listNASubjects(Model m)
throws RDFException
m - Model
Collection of Resources
RDFException - Description of the Exception
public static List listNASubjects(Model m,
Property predicate,
RDFNode object)
throws RDFException
m - Modelpredicate - Predicateobject - Object
Collection of Resources
RDFException - Description of the Exception
public static List listAnonymous(Model m)
throws RDFException
m - Model
Collection of Resources
RDFException
public static boolean isEmpty(Model m)
throws RDFException
m - Model
RDFException
public static boolean isAnon(Resource res)
throws RDFException
Resource.isAnon(), a
Resource is also considered to be anonymous if its URI ends with
"#A<number>". This is due to parsing problems(?) with
anonymous resources and RDF/XML.
res - Resource
true if anonymous
RDFException
public static boolean isFakeAnon(Resource res)
throws RDFException
RDFException
public static void replace(Model m,
RDFNode orig,
RDFNode node)
throws RDFException
orig with node.
Can be compared to performing a "rename" of an URI or Literal.
m - Modelorig - Original Node (Resource or Literal)node - "New" Node (Resource or Literal)
RDFException
public static void replace(Model m,
Resource subj,
Property pred,
RDFNode obj)
throws RDFException
RDFExceptionpublic static void main(String[] args)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||