org.weblab_project.core.helper.impl
Class JenaResourceHelper

java.lang.Object
  extended by org.weblab_project.core.helper.impl.JenaResourceHelper
All Implemented Interfaces:
org.weblab_project.core.helper.ResourceHelper
Direct Known Subclasses:
JenaResourceHelperExtended, JenaSingleResourceHelper

public class JenaResourceHelper
extends java.lang.Object
implements org.weblab_project.core.helper.ResourceHelper

This is an implementation of the ResourceHelper. It loads every Annotations that are on this object and in the inner Resources. If the loaded Resource is an Annotation, its content won't be loaded.

Author:
EADS WebLab Team
To do:
Prevent the direct instantiation of this class.
Date:
2008-11-25

Field Summary
protected  org.weblab_project.utils.BackEndJenaHelper bejh
          An handler for the Jena model behind.
protected  org.weblab_project.core.model.Resource resource
          The current Resource object loaded.
protected  java.util.Map<java.lang.String,org.weblab_project.core.model.Resource> resourcesMap
          Map to remember the mapping between sub-resources and resource URIs
 
Constructor Summary
JenaResourceHelper()
           
 
Method Summary
protected  void addCell(org.weblab_project.core.model.structure.Cell cell)
           
protected  void addComposedQuery(org.weblab_project.core.model.query.ComposedQuery cq)
           
protected  void addComposedUnit(org.weblab_project.core.model.ComposedUnit cu)
           
protected  void addLine(org.weblab_project.core.model.structure.Line l)
           
protected  void addMediaUnit(org.weblab_project.core.model.MediaUnit mu)
           
protected  void addPieceOfKnowledge(org.weblab_project.core.model.PieceOfKnowledge pok)
           
protected  void addResource(org.weblab_project.core.model.Resource res)
          Method recursively called to add every resources in the model and in the map.
protected  void addResourceCollection(org.weblab_project.core.model.ResourceCollection rc)
           
protected  void addResultSet(org.weblab_project.core.model.query.ResultSet rs)
           
protected  void addSimilarityQuery(org.weblab_project.core.model.query.SimilarityQuery sq)
           
protected  void addTable(org.weblab_project.core.model.structure.Table t)
           
 java.util.List<java.lang.String> getLitsOnPredSubj(java.lang.String uriSubj, java.lang.String uriPred)
           
 java.util.List<java.lang.String> getLitsOnPredSubj(java.lang.String uriSubj, java.lang.String uriPred, java.lang.String language)
           
 java.util.Set<java.lang.String> getPreds()
           
 java.util.Set<java.lang.String> getPredsOnSubj(java.lang.String uriSubj)
           
 java.lang.String getRdfXml()
           
 org.weblab_project.core.model.Resource getResource()
           
 org.weblab_project.core.model.Resource getResource(java.lang.String uri)
           
 java.util.List<java.lang.String> getRessOnPredSubj(java.lang.String uriSubj, java.lang.String uriPred)
           
<T extends org.weblab_project.core.model.Resource>
T
getSpecificResource(java.lang.String uri, java.lang.Class<T> specificClass)
           
 java.util.Set<java.lang.String> getSubjs()
           
 java.util.Set<java.lang.String> getSubjsOnPred(java.lang.String uriPred)
           
 java.util.Set<java.lang.String> getSubjsOnPredLit(java.lang.String uriPred, java.lang.String litObj)
           
 java.util.Set<java.lang.String> getSubjsOnPredRes(java.lang.String uriPred, java.lang.String uriObj)
           
 java.lang.Class<? extends org.weblab_project.core.model.Resource> getType(java.lang.String uri)
           
 boolean hasLitStat(java.lang.String uriSubj, java.lang.String uriPred, java.lang.String litObj)
           
 boolean hasResStat(java.lang.String uriSubj, java.lang.String uriPred, java.lang.String uriObj)
           
 boolean isDefinedResource(java.lang.String uri)
           
 boolean isFullyDefinedResource(java.lang.String uri)
           
 void loadFromRdfXml(java.lang.String rdfXml)
           
protected  void loadFromRdfXml(java.lang.String rdfXml, boolean add)
           
 void setResource(org.weblab_project.core.model.Resource resource)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resource

protected org.weblab_project.core.model.Resource resource
The current Resource object loaded.


resourcesMap

protected java.util.Map<java.lang.String,org.weblab_project.core.model.Resource> resourcesMap
Map to remember the mapping between sub-resources and resource URIs


bejh

protected org.weblab_project.utils.BackEndJenaHelper bejh
An handler for the Jena model behind.

Constructor Detail

JenaResourceHelper

public JenaResourceHelper()
Method Detail

getResource

public org.weblab_project.core.model.Resource getResource(java.lang.String uri)
                                                   throws org.weblab_project.core.exception.WebLabCheckedException
Specified by:
getResource in interface org.weblab_project.core.helper.ResourceHelper
Throws:
org.weblab_project.core.exception.WebLabCheckedException

getSpecificResource

public <T extends org.weblab_project.core.model.Resource> T getSpecificResource(java.lang.String uri,
                                                                                java.lang.Class<T> specificClass)
                                                                     throws org.weblab_project.core.exception.WebLabCheckedException
Specified by:
getSpecificResource in interface org.weblab_project.core.helper.ResourceHelper
Throws:
org.weblab_project.core.exception.WebLabCheckedException

getType

public java.lang.Class<? extends org.weblab_project.core.model.Resource> getType(java.lang.String uri)
                                                                          throws org.weblab_project.core.exception.WebLabCheckedException
Specified by:
getType in interface org.weblab_project.core.helper.ResourceHelper
Throws:
org.weblab_project.core.exception.WebLabCheckedException

setResource

public void setResource(org.weblab_project.core.model.Resource resource)
Specified by:
setResource in interface org.weblab_project.core.helper.ResourceHelper

addResource

protected void addResource(org.weblab_project.core.model.Resource res)
Method recursively called to add every resources in the model and in the map.

Parameters:
res - The resource to add.

addSimilarityQuery

protected void addSimilarityQuery(org.weblab_project.core.model.query.SimilarityQuery sq)
Parameters:
sq - The similarity query to add.

addComposedQuery

protected void addComposedQuery(org.weblab_project.core.model.query.ComposedQuery cq)
Parameters:
cq - The composed unit to add.

addResourceCollection

protected void addResourceCollection(org.weblab_project.core.model.ResourceCollection rc)
Parameters:
rc - The resourceCollection to add.

addResultSet

protected void addResultSet(org.weblab_project.core.model.query.ResultSet rs)
Parameters:
rs - The resultSet to add.

addPieceOfKnowledge

protected void addPieceOfKnowledge(org.weblab_project.core.model.PieceOfKnowledge pok)
Parameters:
a - The pok to add.

addMediaUnit

protected void addMediaUnit(org.weblab_project.core.model.MediaUnit mu)
Parameters:
mu - The mediaUnit to add.

addTable

protected void addTable(org.weblab_project.core.model.structure.Table t)
Parameters:
t - The table to add.

addLine

protected void addLine(org.weblab_project.core.model.structure.Line l)
Parameters:
l - The line to add

addCell

protected void addCell(org.weblab_project.core.model.structure.Cell cell)
Parameters:
cell - The cell to add.

addComposedUnit

protected void addComposedUnit(org.weblab_project.core.model.ComposedUnit cu)
Parameters:
cu -

getLitsOnPredSubj

public java.util.List<java.lang.String> getLitsOnPredSubj(java.lang.String uriSubj,
                                                          java.lang.String uriPred)

getPredsOnSubj

public java.util.Set<java.lang.String> getPredsOnSubj(java.lang.String uriSubj)

getRessOnPredSubj

public java.util.List<java.lang.String> getRessOnPredSubj(java.lang.String uriSubj,
                                                          java.lang.String uriPred)

getSubjs

public java.util.Set<java.lang.String> getSubjs()

getSubjsOnPred

public java.util.Set<java.lang.String> getSubjsOnPred(java.lang.String uriPred)

getSubjsOnPredLit

public java.util.Set<java.lang.String> getSubjsOnPredLit(java.lang.String uriPred,
                                                         java.lang.String litObj)

getSubjsOnPredRes

public java.util.Set<java.lang.String> getSubjsOnPredRes(java.lang.String uriPred,
                                                         java.lang.String uriObj)

hasLitStat

public boolean hasLitStat(java.lang.String uriSubj,
                          java.lang.String uriPred,
                          java.lang.String litObj)

hasResStat

public boolean hasResStat(java.lang.String uriSubj,
                          java.lang.String uriPred,
                          java.lang.String uriObj)

isDefinedResource

public boolean isDefinedResource(java.lang.String uri)

loadFromRdfXml

public void loadFromRdfXml(java.lang.String rdfXml)
                    throws org.weblab_project.core.exception.WebLabCheckedException
Throws:
org.weblab_project.core.exception.WebLabCheckedException

loadFromRdfXml

protected void loadFromRdfXml(java.lang.String rdfXml,
                              boolean add)
Parameters:
rdfXml - An RDF/XML String to be loaded or added to teh current model
add - Whether to add rdfXml to current model or to create a new model from scratch.

getResource

public org.weblab_project.core.model.Resource getResource()
Specified by:
getResource in interface org.weblab_project.core.helper.ResourceHelper

isFullyDefinedResource

public boolean isFullyDefinedResource(java.lang.String uri)
Specified by:
isFullyDefinedResource in interface org.weblab_project.core.helper.ResourceHelper

getPreds

public java.util.Set<java.lang.String> getPreds()

getRdfXml

public java.lang.String getRdfXml()

getLitsOnPredSubj

public java.util.List<java.lang.String> getLitsOnPredSubj(java.lang.String uriSubj,
                                                          java.lang.String uriPred,
                                                          java.lang.String language)


Copyright © 2004-2009. All Rights Reserved.