org.ow2.weblab.rdf
Class RDFReader

java.lang.Object
  extended by org.ow2.weblab.rdf.RDFReader
All Implemented Interfaces:
CommonNamespaces

public class RDFReader
extends java.lang.Object
implements CommonNamespaces


Field Summary
 
Fields inherited from interface org.ow2.weblab.rdf.CommonNamespaces
DUBLIN_CORE_PREFIX, DUBLIN_CORE_URI, RDF_PREFIX, RDF_URI, RDFS_PREFIX, RDFS_URI
 
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
<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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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 written
subject - the subject of the property
namespace - the namespace of the property
property - the localname of the property
language - the language attribute of the property
clazz - 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 node
subject - 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.