org.weblab_project.core.helper.impl
Class WTriple

java.lang.Object
  extended by org.weblab_project.core.helper.impl.WTriple

public class WTriple
extends java.lang.Object

A container class composed by a subject, a predicate and an object. The subject and the object can be either an URI or an URI and a reference to a WebLab Resource.

Author:
EADS WebLab Team
Date:
2009-03-11

Constructor Summary
WTriple(com.hp.hpl.jena.graph.Node s, com.hp.hpl.jena.graph.Node p, com.hp.hpl.jena.graph.Node o, java.lang.String annotatedText, org.weblab_project.core.model.Resource annotatedOn, java.util.List<org.weblab_project.core.model.Resource> resources)
           
WTriple(com.hp.hpl.jena.graph.Triple triple, java.lang.String annotatedText, org.weblab_project.core.model.Resource annotatedOn, java.util.List<org.weblab_project.core.model.Resource> resources)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 org.weblab_project.core.model.PieceOfKnowledge from()
          Returns the PieceOfKnowledge in which this triplet is defined.
 org.weblab_project.core.model.Resource getAnnotatedOn()
          Returns the Resource on which the annotation define this triple.
 java.lang.String getObject()
          Returns the value of the object
 org.weblab_project.core.model.Resource getObjectResource()
          Returns the Resource if the object is a WebLab Resource else null
 java.lang.String getPredicate()
          Return the URI of the predicate
protected  WTriple getReifiedWTriple()
           
 java.lang.String getSubject()
          Return the URI of the subject
 org.weblab_project.core.model.Resource getSubjectResource()
          Returns the Resource if the subject is a WebLab Resource else null
 java.lang.String getText()
          Return the text corresponding to the segment on which the annotation
 com.hp.hpl.jena.graph.Triple getTriple()
          Return the Jena Triple use to build the WTriple
 int hashCode()
           
 void setAnnotation(org.weblab_project.core.model.PieceOfKnowledge annotation)
           
protected  void setReifiedWTriple(WTriple reifiedWTriple)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WTriple

public WTriple(com.hp.hpl.jena.graph.Node s,
               com.hp.hpl.jena.graph.Node p,
               com.hp.hpl.jena.graph.Node o,
               java.lang.String annotatedText,
               org.weblab_project.core.model.Resource annotatedOn,
               java.util.List<org.weblab_project.core.model.Resource> resources)

WTriple

public WTriple(com.hp.hpl.jena.graph.Triple triple,
               java.lang.String annotatedText,
               org.weblab_project.core.model.Resource annotatedOn,
               java.util.List<org.weblab_project.core.model.Resource> resources)
Method Detail

setAnnotation

public void setAnnotation(org.weblab_project.core.model.PieceOfKnowledge annotation)

from

public org.weblab_project.core.model.PieceOfKnowledge from()
Returns the PieceOfKnowledge in which this triplet is defined.

Returns:
a PieceOfKnowledge

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getAnnotatedOn

public org.weblab_project.core.model.Resource getAnnotatedOn()
Returns the Resource on which the annotation define this triple.

Returns:
a resource

setReifiedWTriple

protected void setReifiedWTriple(WTriple reifiedWTriple)

getReifiedWTriple

protected WTriple getReifiedWTriple()

getText

public java.lang.String getText()
Return the text corresponding to the segment on which the annotation

Returns:
the text for a segment

getPredicate

public java.lang.String getPredicate()
Return the URI of the predicate

Returns:
the URI

getTriple

public com.hp.hpl.jena.graph.Triple getTriple()
Return the Jena Triple use to build the WTriple

Returns:
a Triple

getSubject

public java.lang.String getSubject()
Return the URI of the subject

Returns:
the URI

getSubjectResource

public org.weblab_project.core.model.Resource getSubjectResource()
Returns the Resource if the subject is a WebLab Resource else null

Returns:
a Resource or null

getObject

public java.lang.String getObject()
Returns the value of the object

Returns:
the value

getObjectResource

public org.weblab_project.core.model.Resource getObjectResource()
Returns the Resource if the object is a WebLab Resource else null

Returns:
a Resource or null

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2004-2009. All Rights Reserved.