gr.forth.ics.rdfsuite.swkm.model.impl
Class RDF_Resource

java.lang.Object
  extended by gr.forth.ics.rdfsuite.swkm.model.impl.RDF_Resource
All Implemented Interfaces:
Identifiable, IRDF_Resource
Direct Known Subclasses:
RDF_Container, RDF_Individual, RDF_Schema_Resource, RDF_Statement

public class RDF_Resource
extends java.lang.Object
implements IRDF_Resource


Field Summary
protected  int column
           
protected  java.util.Collection<IRDF_Comment> comments
           
protected  java.util.Collection<IRDF_IsDefinedBy> isDefinedBys
           
protected  java.util.Collection<IRDF_Label> labels
           
protected  int line
           
protected  java.lang.String local_name
           
protected static org.apache.log4j.Logger log
           
protected  IRDF_Namespace namespace
           
protected  java.util.Collection<IRDF_SeeAlso> seeAlsos
           
protected  java.util.Collection<IRDF_Type> types
           
protected  java.lang.String uri
           
 
Constructor Summary
RDF_Resource(java.lang.String uri)
          Constructor for "data" RDF_Resources that are not correlated with a namespace
RDF_Resource(java.lang.String uri, IRDF_Namespace ns)
          Constructor for schema RDF_Resources that are correlated with a Namespace
 
Method Summary
 java.util.Collection<IRDF_Resource> getAllTypes(IRDF_Model model)
          This dummy method is overriden by methods in subclasses(RDF_Class,RDF_Property e.t.c) Parameter RDF_Model is needed in order for the types to be retrieved from the model
 int getColumn()
          Retrieves the column that the resource occured in the input file
 java.util.Collection<IRDF_Literal> getComments()
          Retrieves all the Comments defined for this RDF_Resource
 java.util.Collection<IRDF_Comment> getCommentsTriples()
          Retrieves all the RDF_Comment triples defined for this RDF_Resource
 java.util.Collection<IRDF_Resource> getIsDefinedBys()
          Retrieves all the isDefinedBys defined for this RDF_Resource
 java.util.Collection<IRDF_IsDefinedBy> getIsDefinedBysTriples()
          Retrieves all the RDF_IsDefinedBy triples defined for this RDF_Resource
 java.util.Collection<IRDF_Literal> getLabels()
          Retrieves all the labels defined for this RDF_Resource
 java.util.Collection<IRDF_Label> getLabelsTriples()
          Retrieves all the RDF_Label triples defined for this RDF_Resource
 int getLine()
          Retrieves the line that the resource occured in the input file
 java.lang.String getLocalName()
          Retrieves the local name of the specified Resource,that is - if exists - the part that is after #.In any other case it returns an empty string
 IRDF_Namespace getNamespace()
          Retrieves the namespace this resource belongs to
 java.lang.String getNamespacePart()
          Retrieves the namespace part of the URI of the specified Resource.
 java.util.Collection<IRDF_Resource> getSeeAlsos()
          Adds an label for this IRDF_Resource
 java.util.Collection<IRDF_SeeAlso> getSeeAlsosTriples()
          Retrieves all the RDF_SeeAlso triples defined for this RDF_Resource
 java.util.Collection<IRDF_Resource> getTypes()
          Retrieves the types defined for this resource from the model (Depending to the resource its type may be a metaclass, a class or a property)
 java.util.Collection<IRDF_Type> getTypesTriples()
          Retrieves the type triples defined for this resource from the model
 java.lang.String getURI()
          Composes the namespace of the Resource from the namespace uri and the local name
 boolean hasTypeOf(IRDF_Model model, IRDF_Class rdf_class)
          Tells whether a class is a type class of this resource
 void setColumn(int column)
          Sets the column that the resource occured in the input file
 void setLine(int line)
          Sets the line that the resource occured in the input file
 void setLocalName(java.lang.String localName)
          Sets the local name for the specified resource in case the full URI is not known
 void setNamespace(IRDF_Namespace namespace)
          Sets the namespace this resource belongs to
 void setURI(java.lang.String uri)
          Sets the URI of the specified Resource.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

local_name

protected java.lang.String local_name

uri

protected java.lang.String uri

namespace

protected IRDF_Namespace namespace

comments

protected java.util.Collection<IRDF_Comment> comments

labels

protected java.util.Collection<IRDF_Label> labels

seeAlsos

protected java.util.Collection<IRDF_SeeAlso> seeAlsos

isDefinedBys

protected java.util.Collection<IRDF_IsDefinedBy> isDefinedBys

types

protected java.util.Collection<IRDF_Type> types

log

protected static final org.apache.log4j.Logger log

line

protected int line

column

protected int column
Constructor Detail

RDF_Resource

public RDF_Resource(java.lang.String uri,
                    IRDF_Namespace ns)
             throws gr.forth.ics.rdfsuite.services.exceptions.IncompatibleUrisException
Constructor for schema RDF_Resources that are correlated with a Namespace

Throws:
gr.forth.ics.rdfsuite.services.exceptions.IncompatibleUrisException - if the namespace part of the uri and the namespace it belongs to are not the same

RDF_Resource

public RDF_Resource(java.lang.String uri)
Constructor for "data" RDF_Resources that are not correlated with a namespace

Parameters:
uri -
Method Detail

getComments

public java.util.Collection<IRDF_Literal> getComments()
Description copied from interface: IRDF_Resource
Retrieves all the Comments defined for this RDF_Resource

Specified by:
getComments in interface IRDF_Resource
Returns:
A Collection object

getCommentsTriples

public java.util.Collection<IRDF_Comment> getCommentsTriples()
Description copied from interface: IRDF_Resource
Retrieves all the RDF_Comment triples defined for this RDF_Resource

Specified by:
getCommentsTriples in interface IRDF_Resource
Returns:
A Collection object

getIsDefinedBys

public java.util.Collection<IRDF_Resource> getIsDefinedBys()
Description copied from interface: IRDF_Resource
Retrieves all the isDefinedBys defined for this RDF_Resource

Specified by:
getIsDefinedBys in interface IRDF_Resource
Returns:
A Collection object

getIsDefinedBysTriples

public java.util.Collection<IRDF_IsDefinedBy> getIsDefinedBysTriples()
Description copied from interface: IRDF_Resource
Retrieves all the RDF_IsDefinedBy triples defined for this RDF_Resource

Specified by:
getIsDefinedBysTriples in interface IRDF_Resource
Returns:
A Collection object

getLabels

public java.util.Collection<IRDF_Literal> getLabels()
Description copied from interface: IRDF_Resource
Retrieves all the labels defined for this RDF_Resource

Specified by:
getLabels in interface IRDF_Resource
Returns:
A Collection object

getLabelsTriples

public java.util.Collection<IRDF_Label> getLabelsTriples()
Description copied from interface: IRDF_Resource
Retrieves all the RDF_Label triples defined for this RDF_Resource

Specified by:
getLabelsTriples in interface IRDF_Resource
Returns:
A Collection object

getLocalName

public java.lang.String getLocalName()
Description copied from interface: IRDF_Resource
Retrieves the local name of the specified Resource,that is - if exists - the part that is after #.In any other case it returns an empty string

Specified by:
getLocalName in interface IRDF_Resource
Returns:
The local name of the specified Resource

getNamespace

public IRDF_Namespace getNamespace()
Description copied from interface: IRDF_Resource
Retrieves the namespace this resource belongs to

Specified by:
getNamespace in interface IRDF_Resource
Returns:
An IRDF_Namespace object

getNamespacePart

public java.lang.String getNamespacePart()
Description copied from interface: IRDF_Resource
Retrieves the namespace part of the URI of the specified Resource. The namespace part is the part of the URI from its beggining until "#" sign if it exists(It contains "#")

Specified by:
getNamespacePart in interface IRDF_Resource
Returns:
The namespace part of the URI of the specified Resource

getSeeAlsos

public java.util.Collection<IRDF_Resource> getSeeAlsos()
Description copied from interface: IRDF_Resource
Adds an label for this IRDF_Resource

Specified by:
getSeeAlsos in interface IRDF_Resource
Returns:
A Collection object

getSeeAlsosTriples

public java.util.Collection<IRDF_SeeAlso> getSeeAlsosTriples()
Description copied from interface: IRDF_Resource
Retrieves all the RDF_SeeAlso triples defined for this RDF_Resource

Specified by:
getSeeAlsosTriples in interface IRDF_Resource
Returns:
A Collection object

getTypes

public java.util.Collection<IRDF_Resource> getTypes()
Description copied from interface: IRDF_Resource
Retrieves the types defined for this resource from the model (Depending to the resource its type may be a metaclass, a class or a property)

Specified by:
getTypes in interface IRDF_Resource
Returns:
A Collection object

getTypesTriples

public java.util.Collection<IRDF_Type> getTypesTriples()
Description copied from interface: IRDF_Resource
Retrieves the type triples defined for this resource from the model

Specified by:
getTypesTriples in interface IRDF_Resource
Returns:
A Collection object

getURI

public java.lang.String getURI()
Description copied from interface: IRDF_Resource
Composes the namespace of the Resource from the namespace uri and the local name

Specified by:
getURI in interface Identifiable
Specified by:
getURI in interface IRDF_Resource
Returns:
The URI of the specified Resource

setLocalName

public void setLocalName(java.lang.String localName)
Description copied from interface: IRDF_Resource
Sets the local name for the specified resource in case the full URI is not known

Specified by:
setLocalName in interface IRDF_Resource

setNamespace

public void setNamespace(IRDF_Namespace namespace)
Description copied from interface: IRDF_Resource
Sets the namespace this resource belongs to

Specified by:
setNamespace in interface IRDF_Resource
Parameters:
namespace - An IRDF_Namespace object

setURI

public void setURI(java.lang.String uri)
            throws gr.forth.ics.rdfsuite.services.exceptions.IncompatibleUrisException
Description copied from interface: IRDF_Resource
Sets the URI of the specified Resource. If the namespace part of the uri is inconsistent to the namespace's uri an excetion is thrown

Specified by:
setURI in interface Identifiable
Specified by:
setURI in interface IRDF_Resource
Parameters:
uri - The URI to be set to the Resource
Throws:
gr.forth.ics.rdfsuite.services.exceptions.IncompatibleUrisException - if the namespace part of the uri and the namespace it belongs to are not compatible

getColumn

public int getColumn()
Description copied from interface: IRDF_Resource
Retrieves the column that the resource occured in the input file

Specified by:
getColumn in interface IRDF_Resource
Returns:
An int

getLine

public int getLine()
Description copied from interface: IRDF_Resource
Retrieves the line that the resource occured in the input file

Specified by:
getLine in interface IRDF_Resource
Returns:
An int

setColumn

public void setColumn(int column)
Description copied from interface: IRDF_Resource
Sets the column that the resource occured in the input file

Specified by:
setColumn in interface IRDF_Resource
Parameters:
column - An int

setLine

public void setLine(int line)
Description copied from interface: IRDF_Resource
Sets the line that the resource occured in the input file

Specified by:
setLine in interface IRDF_Resource
Parameters:
line - An int

hasTypeOf

public boolean hasTypeOf(IRDF_Model model,
                         IRDF_Class rdf_class)
Description copied from interface: IRDF_Resource
Tells whether a class is a type class of this resource

Specified by:
hasTypeOf in interface IRDF_Resource
rdf_class - The candidate type class
Returns:
True if this resource is type of the given class

getAllTypes

public java.util.Collection<IRDF_Resource> getAllTypes(IRDF_Model model)
This dummy method is overriden by methods in subclasses(RDF_Class,RDF_Property e.t.c) Parameter RDF_Model is needed in order for the types to be retrieved from the model

Specified by:
getAllTypes in interface IRDF_Resource
Returns:

toString

public java.lang.String toString()
Specified by:
toString in interface IRDF_Resource
Overrides:
toString in class java.lang.Object