org.ow2.weblab.rdf
Class RDFReader
java.lang.Object
org.ow2.weblab.rdf.RDFReader
- All Implemented Interfaces:
- CommonNamespaces
public class RDFReader
- extends java.lang.Object
- implements CommonNamespaces
Method Summary |
protected static org.w3c.dom.Node |
findDescriptionAbout(org.w3c.dom.Node n,
java.lang.String subject)
|
protected static org.w3c.dom.Node |
findDescriptionAboutIn(org.w3c.dom.Node n,
java.lang.String subject)
Breadth first search should be more efficient than depth first search |
protected static java.util.List<org.w3c.dom.Node> |
findNodesWithProperty(org.w3c.dom.Node n,
java.lang.String namespace,
java.lang.String property)
|
protected static org.w3c.dom.Node |
findRDF(org.w3c.dom.Node dom)
|
protected static java.lang.String |
getLanguage(org.w3c.dom.Node node)
|
protected static java.lang.String |
getResource(org.w3c.dom.Node n)
|
protected static boolean |
isDescriptionAbout(org.w3c.dom.Node n,
java.lang.String subject)
|
protected static void |
print(org.w3c.dom.Node n,
java.lang.String space)
|
static
|
readValueFromStatement(PieceOfKnowledge annotation,
java.net.URI subject,
java.net.URI namespace,
java.lang.String property,
java.lang.String language,
java.lang.Class<T> clazz)
Read the value of a property described in RDF |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
readValueFromStatement
public static <T> Value<T> readValueFromStatement(PieceOfKnowledge annotation,
java.net.URI subject,
java.net.URI namespace,
java.lang.String property,
java.lang.String language,
java.lang.Class<T> clazz)
- Read the value of a property described in RDF
- Type Parameters:
T
- the type of the value- Parameters:
annotation
- the annotation on which the property is writtensubject
- the subject of the propertynamespace
- the namespace of the propertyproperty
- the localname of the propertylanguage
- the language attribute of the propertyclazz
- the class of the type T
- Returns:
- A Value object typed with T that contains all values of the property
getResource
protected static java.lang.String getResource(org.w3c.dom.Node n)
findNodesWithProperty
protected static java.util.List<org.w3c.dom.Node> findNodesWithProperty(org.w3c.dom.Node n,
java.lang.String namespace,
java.lang.String property)
getLanguage
protected static java.lang.String getLanguage(org.w3c.dom.Node node)
findDescriptionAboutIn
protected static org.w3c.dom.Node findDescriptionAboutIn(org.w3c.dom.Node n,
java.lang.String subject)
- Breadth first search should be more efficient than depth first search
- Parameters:
n
- a nodesubject
- the subject we search
- Returns:
- the rdf:description node about the subject or null if it does not exist
findDescriptionAbout
protected static org.w3c.dom.Node findDescriptionAbout(org.w3c.dom.Node n,
java.lang.String subject)
isDescriptionAbout
protected static boolean isDescriptionAbout(org.w3c.dom.Node n,
java.lang.String subject)
findRDF
protected static org.w3c.dom.Node findRDF(org.w3c.dom.Node dom)
print
protected static void print(org.w3c.dom.Node n,
java.lang.String space)
Copyright © 2004-2010. All Rights Reserved.