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

java.lang.Object
  extended by gr.forth.ics.rdfsuite.swkm.model.impl.RDF_Namespace
All Implemented Interfaces:
Identifiable, IRDF_Namespace
Direct Known Subclasses:
RDFDB_Namespace

public class RDF_Namespace
extends java.lang.Object
implements IRDF_Namespace


Field Summary
protected  org.apache.commons.collections.MultiMap comments
           
protected  org.apache.commons.collections.MultiMap domains
           
protected  org.apache.commons.collections.MultiMap isdefinedbys
           
protected  org.apache.commons.collections.MultiMap labels
           
protected static org.apache.log4j.Logger log
           
protected  org.apache.commons.collections.MultiMap members
           
protected  java.util.HashMap<IRDF_Statement,IRDF_Object> objects
           
protected  java.util.HashMap<IRDF_Statement,IRDF_Predicate> predicates
           
protected  org.apache.commons.collections.MultiMap ranges
           
protected  org.apache.commons.collections.MultiMap seealsos
           
protected  org.apache.commons.collections.MultiMap subclasses
           
protected  java.util.HashMap<IRDF_Statement,IRDF_Subject> subjects
           
protected  org.apache.commons.collections.MultiMap subproperties
           
 org.apache.commons.collections.MultiMap types
           
 
Constructor Summary
RDF_Namespace(IRDF_Model model)
           
RDF_Namespace(java.lang.String namespace_uri, IRDF_Model model)
           
 
Method Summary
 void addClass(IRDF_Class rdf_class)
          Adds an RDF_Class in Main Memort
 void addNamespaceDependency(IRDF_Namespace namespace)
          Adds a namespace dependency to this namespace
 void addProperty(IRDF_Property rdf_property)
          Adds an RDF_Property in Main Memort
 void addStatement(IRDF_Statement rdf_statement)
          Adds an RDF_Statement in Main Memort
protected  IRDF_MetaClass castClassToMetaClass(IRDF_Model model, IRDF_Class rdf_class, int kind)
          Casting a Class into MetaClass.
protected  void castClassToPropertyAndUpdateReferences(IRDF_Model model, java.lang.String property_uri, IRDF_Property rdf_property)
           
protected  IRDF_Class createClass(IRDF_Model model, java.lang.String class_uri, Position pos)
          Creates an IRDF_Class and adds it to this namespace,as well as performing all other initializations.
protected  IRDF_MetaClass createMetaClassOfClasses(IRDF_Model model, java.lang.String meta_class_uri, Position pos)
          Creates an rdf metaclass but without creating the subclass triple to the rdf schema class which is the actual requirement for a class to be a metaclass
protected  IRDF_MetaClass createMetaClassOfProperties(IRDF_Model model, java.lang.String meta_class_uri, Position pos)
          Creates an rdf metaclass but without creating the subclass triple to the rdf schema class which is the actual requirement for a class to be a metaclass
protected  IRDF_Property createProperty(IRDF_Model model, java.lang.String property_uri, Position pos)
          Creates an IRDF_Property and adds it to this namespace,as well as performing all other initializations.
protected  IRDF_Statement createStatement(RDF_Model model, java.lang.String statement_uri, Position pos)
          Creates an IRDF_Statement and adds it to this namespace,as well as performing all other initializations.
protected  int enter_comment(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, RDF_Model model, java.lang.String graphspace_uri, boolean strict)
          This method handles the comments on schema resources like classes,properties,etc The comments on class instances are handled by other method
protected  int enter_domain(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, RDF_Model model, java.lang.String graphspace_uri, boolean strict)
           
protected  int enter_isDefinedBy(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, RDF_Model model, java.lang.String graphspace_uri, boolean strict)
           
protected  int enter_label(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, RDF_Model model, java.lang.String graphspace_uri, boolean strict)
           
protected  int enter_property(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, java.lang.String graphspace_uri, boolean strict, RDF_Model model)
           
protected  int enter_range(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, RDF_Model model, java.lang.String graphspace_uri, boolean strict)
           
protected  int enter_s_p_o(int i, java.lang.String subject, java.lang.String object, Position pos, RDF_Model model, java.lang.String graphspace_uri, boolean strict)
           
protected  int enter_seeAlso(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, RDF_Model model, java.lang.String graphspace_uri, boolean strict)
           
protected  int enter_subClassOf(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, IRDF_Model model, java.lang.String graphspace_uri, boolean strict)
           
protected  int enter_subPropertyOf(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, RDF_Model model, java.lang.String graphspace_uri, boolean strict)
           
protected  void enter_type_case_object_metaclass(java.lang.String subject, IRDF_MetaClass object_metaclass, Position pos, java.lang.String graphspace_uri, RDF_Model model, IRDF_Namespace triple_namespace, boolean inferred)
          Note that this namespace is not necessarily the same with subject's namespace
protected  void enter_type_case_object_metaproperty(java.lang.String subject, IRDF_MetaClass object_metaproperty, Position pos, java.lang.String graphspace_uri, RDF_Model model, IRDF_Namespace triple_namespace, boolean inferred)
          Note that this namespace is not necessarily the same with subject's namespace
protected  void enter_type_case_object_rdfschema_class(java.lang.String subject, Position pos, java.lang.String graphspace_uri, IRDF_Model model, IRDF_Namespace triple_namespace, boolean inferred)
          Note that this namespace is not necessarily the same with subject's namespace
protected  void enter_type_case_object_resource(java.lang.String subject, IRDF_Resource object_resource, Position pos, java.lang.String graphspace_uri, RDF_Model model, IRDF_Namespace triple_namespace, boolean inferred)
          Note that this namespace is not necessarily the same with subject's namespace\ Creating a type triple A type B where we dont know what B is.
protected  void enter_type_case_rdf_property(java.lang.String subject, Position pos, java.lang.String graphspace_uri, RDF_Model model, IRDF_Namespace triple_namespace, boolean inferred)
          Note that this namespace is not necessarily the same with subject's namespace
protected  void enter_type_case_statement(java.lang.String subject, Position pos, java.lang.String graphspace_uri, RDF_Model model, IRDF_Namespace triple_namespace, boolean inferred)
           
protected  int enter_type(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, java.lang.String graphspace_uri, boolean strict, RDF_Model model)
           
 IRDF_Class getClass(java.lang.String class_uri)
          Retrieves an RDF_Class from MM given its uri
 java.util.HashMap getClasses()
          Retrieves all the classes defined in this namespace
 java.util.Collection getComment(IRDF_Resource rdf_resource)
          Retrieves the Collection of RDF_Comment objects in which rdf_resource "participates"
 org.apache.commons.collections.MultiMap getComments()
          Retrieves all the comment relations stored in main memory
 java.util.Collection getDomain(IRDF_Property rdf_property)
          Retrieves the Collection of RDF_Domains objects in which rdf_property "participates"
 org.apache.commons.collections.MultiMap getDomains()
          Retrieves all the domain relations stored in main memory
 java.util.Collection getIsDefinedBy(IRDF_Resource rdf_resource)
          Retrieves the Collection of RDF_IsDefinedBy objects in which rdf_resource "participates"
 org.apache.commons.collections.MultiMap getIsDefinedBys()
          Retrieves all the isDefinedBy relations stored in main memory
 java.util.Collection getLabel(IRDF_Resource rdf_resource)
          Retrieves the Collection of RDF_Label objects in which rdf_resource "participates"
 org.apache.commons.collections.MultiMap getLabels()
          Retrieves all the label relations stored in main memory
 java.util.Collection getMember(IRDF_Container container)
          Retrieves the Collection of RDF_Member objects in which rdf_container "participates"
 org.apache.commons.collections.MultiMap getMembers()
          Retrieves all the container membership relations stored in main memory
 IRDF_Model getModel()
           
 java.util.HashMap<java.lang.String,IRDF_Namespace> getNamespaceDependencies()
          Gets the namespaces this namespace depends on
 IRDF_Object getObject(IRDF_Statement rdf_statement)
          Retrieves the Collection of RDF_Object objects in which rdf_statement "participates"
 java.util.HashMap<IRDF_Statement,IRDF_Object> getObjects()
          Retrieves all the object relations stored in main memory
protected  IRDF_Comment getOrCreateCommentTriple(IRDF_Model model, IRDF_Resource subject_resource, IRDF_Literal comment, IRDF_Namespace subject_namespace, boolean inferred)
          If a subclass triple for subject class and object_class already exists it retrieves it ore else it creates a new one
protected  IRDF_Domain getOrCreateDomainTriple(IRDF_Model model, IRDF_Property subject_property, IRDF_Class object_class, IRDF_Namespace subject_namespace, boolean inferred)
          If a domain triple for subject property and object_class already exists it retrieves it or else it creates a new one
protected  IRDF_IsDefinedBy getOrCreateIsDefinedByTriple(IRDF_Model model, IRDF_Resource subject_resource, IRDF_Resource isdefinedby, IRDF_Namespace subject_namespace, boolean inferred)
          If a subclass triple for subject class and object_class already exists it retrieves it ore else it creates a new one
protected  IRDF_Label getOrCreateLabelTriple(IRDF_Model model, IRDF_Resource subject_resource, IRDF_Literal label, IRDF_Namespace subject_namespace, boolean inferred)
          If a subclass triple for subject class and object_class already exists it retrieves it ore else it creates a new one
protected  IRDF_Range getOrCreateRangeTriple(IRDF_Model model, IRDF_Property subject_property, IRDF_Class object_class, IRDF_Namespace subject_namespace, boolean inferred)
          If a range triple for subject property and object_class already exists it retrieves it or else it creates a new one
protected  IRDF_SeeAlso getOrCreateSeeAlsoTriple(IRDF_Model model, IRDF_Resource subject_class, IRDF_Resource seealso, IRDF_Namespace subject_namespace, boolean inferred)
          If a subclass triple for subject class and object_class already exists it retrieves it ore else it creates a new one
protected  IRDF_Object getOrCreateStatementObjectTriple(IRDF_Model model, IRDF_Statement subject_statement, java.lang.Object object, IRDF_Namespace subject_namespace, boolean inferred)
          If a subproperty triple for subject property and object_property already exists it retrieves it or else it creates a new one
protected  IRDF_Predicate getOrCreateStatementPredicateTriple(IRDF_Model model, IRDF_Statement subject_statement, IRDF_Property object_resource, IRDF_Namespace subject_namespace, boolean inferred)
          If a subproperty triple for subject property and object_property already exists it retrieves it or else it creates a new one
protected  IRDF_Subject getOrCreateStatementSubjectTriple(IRDF_Model model, IRDF_Statement subject_statement, IRDF_Resource object_resource, IRDF_Namespace subject_namespace, boolean inferred)
          If a subproperty triple for subject property and object_property already exists it retrieves it or else it creates a new one
protected  IRDF_SubClass getOrCreateSubClassTriple(IRDF_Model model, IRDF_Class subject_class, IRDF_Class object_class, IRDF_Namespace subject_namespace, boolean inferred)
          If a subclass triple for subject class and object_class already exists it retrieves it ore else it creates a new one
protected  IRDF_SubProperty getOrCreateSubPropertyTriple(IRDF_Model model, IRDF_Property subject_property, IRDF_Property object_property, IRDF_Namespace subject_namespace, boolean inferred)
          If a subproperty triple for subject property and object_property already exists it retrieves it or else it creates a new one
protected  IRDF_Type getOrCreateTypeTriple(IRDF_Model model, IRDF_Resource subject_resource, IRDF_Resource object_resource, IRDF_Namespace namespace, boolean inferred)
          If a type triple for subject resource with type the object_resource already exists it retrieves it or else if object_resource is null checks for a type triple with any object or else creates a new one
 IRDF_Predicate getPredicate(IRDF_Statement statement)
          Retrieves the Collection of RDF_Predicate objects in which statement "participates"
 java.util.HashMap<IRDF_Statement,IRDF_Predicate> getPredicates()
          Retrieves all the predicate relations stored in main memory
 java.util.HashMap getProperties()
          Retrieves all the properties defined in this namespace
 IRDF_Property getProperty(java.lang.String property_uri)
          Retrieves an RDF_Property from MM given its uri
 java.util.Collection getRange(IRDF_Property rdf_property)
          Retrieves the Collection of RDF_Range objects in which rdf_property "participates"
 org.apache.commons.collections.MultiMap getRanges()
          Retrieves all the range relations stored in main memory
 java.util.Collection getSeeAlso(IRDF_Resource rdf_resource)
          Retrieves the Collection of RDF_SeeAlso objects in which rdf_resource "participates"
 org.apache.commons.collections.MultiMap getSeeAlsos()
          Retrieves all the seeAlso relations stored in main memory
 IRDF_Statement getStatement(java.lang.String statement_uri)
          Retrieves an RDF_Statement from MM given its uri
 java.util.HashMap getStatements()
          Retrieves all the statementes defined in this namespace
 java.util.Collection getSubClass(IRDF_Class rdf_class)
          Retrieves the Collection of RDF_SubClass objects in which rdf_class "participates"
 org.apache.commons.collections.MultiMap getSubClasses()
          Retrieves all the subClass relations stored in main memory
 IRDF_Subject getSubject(IRDF_Statement rdf_statement)
          Retrieves the Collection of RDF_Subject objects in which rdf_statement "participates"
 java.util.HashMap<IRDF_Statement,IRDF_Subject> getSubjects()
          Retrieves all the subject relations stored in main memory
 org.apache.commons.collections.MultiMap getSubProperties()
          Retrieves all the subProperty relations stored in main memory
 java.util.Collection getSubProperty(IRDF_Property rdf_property)
          Retrieves the Collection of RDF_SubProperty objects in which rdf_property "participates" as the subproperty.
 java.util.Collection<IRDF_Triple> getTriples()
          Returns a Collection of all triples correlated to this namespace
 java.util.Collection getType(IRDF_Resource resource)
          Retrieves the Collection of RDF_Type objects in which rdf_type "participates"
 org.apache.commons.collections.MultiMap getTypes()
          Retrieves all the type relations stored in main memory
 java.lang.String getURI()
          Retrieves the base uri of this namespace
 int read_triple(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, java.lang.String graphspace_uri, boolean strict, RDF_Model model)
          This method reads and tries to consume a triple created by a parser If the triple is not consumed(is not a schema definition triple) it returns false return 0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)
protected  void removeSubClassTriplesOf(IRDF_Class rdf_class)
           
 void setClasses(java.util.HashMap classes)
          Sets all the classes of this namespace
 void setNamespaceDependencies(java.util.HashMap<java.lang.String,IRDF_Namespace> dependencies)
          Sets the namespaces this namespace depends on
 void setProperties(java.util.HashMap properties)
          Sets all the properties of this namespace
 void setStatements(java.util.HashMap statements)
          Sets all the statementes of this namespace
 void setSubjects(java.util.HashMap<IRDF_Statement,IRDF_Subject> subjects)
           
 void setTypes(org.apache.commons.collections.MultiMap types)
           
 void setURI(java.lang.String new_uri)
          Sets the base uri of this namespace
 java.lang.String toString()
           
 java.util.Collection toTriples()
          Returns a collection of triples where each triple is represented by a collection of 3 string values, subject predicate object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

subclasses

protected org.apache.commons.collections.MultiMap subclasses

subproperties

protected org.apache.commons.collections.MultiMap subproperties

domains

protected org.apache.commons.collections.MultiMap domains

ranges

protected org.apache.commons.collections.MultiMap ranges

subjects

protected java.util.HashMap<IRDF_Statement,IRDF_Subject> subjects

predicates

protected java.util.HashMap<IRDF_Statement,IRDF_Predicate> predicates

objects

protected java.util.HashMap<IRDF_Statement,IRDF_Object> objects

comments

protected org.apache.commons.collections.MultiMap comments

labels

protected org.apache.commons.collections.MultiMap labels

seealsos

protected org.apache.commons.collections.MultiMap seealsos

isdefinedbys

protected org.apache.commons.collections.MultiMap isdefinedbys

members

protected org.apache.commons.collections.MultiMap members

types

public org.apache.commons.collections.MultiMap types

log

protected static final org.apache.log4j.Logger log
Constructor Detail

RDF_Namespace

public RDF_Namespace(IRDF_Model model)

RDF_Namespace

public RDF_Namespace(java.lang.String namespace_uri,
                     IRDF_Model model)
Method Detail

addClass

public void addClass(IRDF_Class rdf_class)
Description copied from interface: IRDF_Namespace
Adds an RDF_Class in Main Memort

Specified by:
addClass in interface IRDF_Namespace
Parameters:
rdf_class - An RDF_Class object

addProperty

public void addProperty(IRDF_Property rdf_property)
Description copied from interface: IRDF_Namespace
Adds an RDF_Property in Main Memort

Specified by:
addProperty in interface IRDF_Namespace
Parameters:
rdf_property - An RDF_Property object

addStatement

public void addStatement(IRDF_Statement rdf_statement)
Description copied from interface: IRDF_Namespace
Adds an RDF_Statement in Main Memort

Specified by:
addStatement in interface IRDF_Namespace
Parameters:
rdf_statement - An RDF_Statement object

getClass

public IRDF_Class getClass(java.lang.String class_uri)
Description copied from interface: IRDF_Namespace
Retrieves an RDF_Class from MM given its uri

Specified by:
getClass in interface IRDF_Namespace
Parameters:
class_uri - A String representing the uri of the class
Returns:
An RDF_Class object

getClasses

public java.util.HashMap getClasses()
Description copied from interface: IRDF_Namespace
Retrieves all the classes defined in this namespace

Specified by:
getClasses in interface IRDF_Namespace
Returns:
A HashMap of (String)class_uri,RDF_Class pairs

getComment

public java.util.Collection getComment(IRDF_Resource rdf_resource)
Description copied from interface: IRDF_Namespace
Retrieves the Collection of RDF_Comment objects in which rdf_resource "participates"

Specified by:
getComment in interface IRDF_Namespace
Parameters:
rdf_resource - An RDF_Resource
Returns:
An Collection object

getComments

public org.apache.commons.collections.MultiMap getComments()
Description copied from interface: IRDF_Namespace
Retrieves all the comment relations stored in main memory

Specified by:
getComments in interface IRDF_Namespace
Returns:
A MultiMap with keys RDF_Resource objects and values collections of RDF_Comment objects

getDomains

public org.apache.commons.collections.MultiMap getDomains()
Description copied from interface: IRDF_Namespace
Retrieves all the domain relations stored in main memory

Specified by:
getDomains in interface IRDF_Namespace
Returns:
A MultiMap with keys RDF_Property objects and values collections of RDF_Domains objects

getDomain

public java.util.Collection getDomain(IRDF_Property rdf_property)
Description copied from interface: IRDF_Namespace
Retrieves the Collection of RDF_Domains objects in which rdf_property "participates"

Specified by:
getDomain in interface IRDF_Namespace
Parameters:
rdf_property - An RDF_Property
Returns:
An Collection object

getIsDefinedBy

public java.util.Collection getIsDefinedBy(IRDF_Resource rdf_resource)
Description copied from interface: IRDF_Namespace
Retrieves the Collection of RDF_IsDefinedBy objects in which rdf_resource "participates"

Specified by:
getIsDefinedBy in interface IRDF_Namespace
Parameters:
rdf_resource - An IRDF_Resource
Returns:
An Collection object

getIsDefinedBys

public org.apache.commons.collections.MultiMap getIsDefinedBys()
Description copied from interface: IRDF_Namespace
Retrieves all the isDefinedBy relations stored in main memory

Specified by:
getIsDefinedBys in interface IRDF_Namespace
Returns:
A MultiMap with keys IRDF_Resource objects and values collections of RDF_IsDefinedBy objects

getLabel

public java.util.Collection getLabel(IRDF_Resource rdf_resource)
Description copied from interface: IRDF_Namespace
Retrieves the Collection of RDF_Label objects in which rdf_resource "participates"

Specified by:
getLabel in interface IRDF_Namespace
Parameters:
rdf_resource - An RDF_Resource
Returns:
An Collection object

getLabels

public org.apache.commons.collections.MultiMap getLabels()
Description copied from interface: IRDF_Namespace
Retrieves all the label relations stored in main memory

Specified by:
getLabels in interface IRDF_Namespace
Returns:
A MultiMap with keys RDF_Resource objects and values collections of RDF_Label objects

getMember

public java.util.Collection getMember(IRDF_Container container)
Description copied from interface: IRDF_Namespace
Retrieves the Collection of RDF_Member objects in which rdf_container "participates"

Specified by:
getMember in interface IRDF_Namespace
Parameters:
container - An RDF_Container
Returns:
An Collection object

getMembers

public org.apache.commons.collections.MultiMap getMembers()
Description copied from interface: IRDF_Namespace
Retrieves all the container membership relations stored in main memory

Specified by:
getMembers in interface IRDF_Namespace
Returns:
A MultiMap with keys RDF_Container objects and values collections of RDF_Member objects

getObject

public IRDF_Object getObject(IRDF_Statement rdf_statement)
Description copied from interface: IRDF_Namespace
Retrieves the Collection of RDF_Object objects in which rdf_statement "participates"

Specified by:
getObject in interface IRDF_Namespace
Parameters:
rdf_statement - An IRDF_Statement
Returns:
An Collection object

getObjects

public java.util.HashMap<IRDF_Statement,IRDF_Object> getObjects()
Description copied from interface: IRDF_Namespace
Retrieves all the object relations stored in main memory

Specified by:
getObjects in interface IRDF_Namespace
Returns:
A MultiMap with keys IRDF_Statement objects and values collections of RDF_Object objects

getPredicate

public IRDF_Predicate getPredicate(IRDF_Statement statement)
Description copied from interface: IRDF_Namespace
Retrieves the Collection of RDF_Predicate objects in which statement "participates"

Specified by:
getPredicate in interface IRDF_Namespace
Parameters:
statement - An IRDF_Statement
Returns:
An Collection object

getPredicates

public java.util.HashMap<IRDF_Statement,IRDF_Predicate> getPredicates()
Description copied from interface: IRDF_Namespace
Retrieves all the predicate relations stored in main memory

Specified by:
getPredicates in interface IRDF_Namespace
Returns:
A MultiMap with keys IRDF_Statement objects and values collections of RDF_Predicate objects

getProperties

public java.util.HashMap getProperties()
Description copied from interface: IRDF_Namespace
Retrieves all the properties defined in this namespace

Specified by:
getProperties in interface IRDF_Namespace
Returns:
A HashMap of (String)property_uri,RDF_Property pairs

getProperty

public IRDF_Property getProperty(java.lang.String property_uri)
Description copied from interface: IRDF_Namespace
Retrieves an RDF_Property from MM given its uri

Specified by:
getProperty in interface IRDF_Namespace
Parameters:
property_uri - A String representing the uri of the property
Returns:
An RDF_Property object

getRange

public java.util.Collection getRange(IRDF_Property rdf_property)
Description copied from interface: IRDF_Namespace
Retrieves the Collection of RDF_Range objects in which rdf_property "participates"

Specified by:
getRange in interface IRDF_Namespace
Parameters:
rdf_property - An IRDF_Property
Returns:
An Collection object

getRanges

public org.apache.commons.collections.MultiMap getRanges()
Description copied from interface: IRDF_Namespace
Retrieves all the range relations stored in main memory

Specified by:
getRanges in interface IRDF_Namespace
Returns:
A MultiMap with keys IRDF_Property objects and values collections of RDF_Range objects

getSeeAlso

public java.util.Collection getSeeAlso(IRDF_Resource rdf_resource)
Description copied from interface: IRDF_Namespace
Retrieves the Collection of RDF_SeeAlso objects in which rdf_resource "participates"

Specified by:
getSeeAlso in interface IRDF_Namespace
Parameters:
rdf_resource - An IRDF_Resource
Returns:
An Collection object

getSeeAlsos

public org.apache.commons.collections.MultiMap getSeeAlsos()
Description copied from interface: IRDF_Namespace
Retrieves all the seeAlso relations stored in main memory

Specified by:
getSeeAlsos in interface IRDF_Namespace
Returns:
A MultiMap with keys IRDF_Resource objects and values collections of RDF_SeeAlso objects

getStatement

public IRDF_Statement getStatement(java.lang.String statement_uri)
Description copied from interface: IRDF_Namespace
Retrieves an RDF_Statement from MM given its uri

Specified by:
getStatement in interface IRDF_Namespace
Parameters:
statement_uri - A String representing the uri of the statement
Returns:
An RDF_Statement object

getStatements

public java.util.HashMap getStatements()
Description copied from interface: IRDF_Namespace
Retrieves all the statementes defined in this namespace

Specified by:
getStatements in interface IRDF_Namespace
Returns:
A HashMap of (String)statement_uri,RDF_Statement pairs

getSubClass

public java.util.Collection getSubClass(IRDF_Class rdf_class)
Description copied from interface: IRDF_Namespace
Retrieves the Collection of RDF_SubClass objects in which rdf_class "participates"

Specified by:
getSubClass in interface IRDF_Namespace
Parameters:
rdf_class - An RDF_Class
Returns:
An Collection object

getSubClasses

public org.apache.commons.collections.MultiMap getSubClasses()
Description copied from interface: IRDF_Namespace
Retrieves all the subClass relations stored in main memory

Specified by:
getSubClasses in interface IRDF_Namespace
Returns:
A MultiMap with keys RDF_Class objects and values collections of RDF_SubClass objects

getSubProperties

public org.apache.commons.collections.MultiMap getSubProperties()
Description copied from interface: IRDF_Namespace
Retrieves all the subProperty relations stored in main memory

Specified by:
getSubProperties in interface IRDF_Namespace
Returns:
A MultiMap with keys RDF_Property objects and values collections of RDF_SubProperty objects

getSubProperty

public java.util.Collection getSubProperty(IRDF_Property rdf_property)
Description copied from interface: IRDF_Namespace
Retrieves the Collection of RDF_SubProperty objects in which rdf_property "participates" as the subproperty. In other words this method retrieves the superproperties of the given property

Specified by:
getSubProperty in interface IRDF_Namespace
Parameters:
rdf_property - An RDF_Property
Returns:
An Collection object

getSubject

public IRDF_Subject getSubject(IRDF_Statement rdf_statement)
Description copied from interface: IRDF_Namespace
Retrieves the Collection of RDF_Subject objects in which rdf_statement "participates"

Specified by:
getSubject in interface IRDF_Namespace
Parameters:
rdf_statement - An RDF_Statement
Returns:
An Collection object

getSubjects

public java.util.HashMap<IRDF_Statement,IRDF_Subject> getSubjects()
Description copied from interface: IRDF_Namespace
Retrieves all the subject relations stored in main memory

Specified by:
getSubjects in interface IRDF_Namespace
Returns:
A MultiMap with keys RDF_Statement objects and values collections of RDF_Subject objects

getType

public java.util.Collection getType(IRDF_Resource resource)
Description copied from interface: IRDF_Namespace
Retrieves the Collection of RDF_Type objects in which rdf_type "participates"

Specified by:
getType in interface IRDF_Namespace
Parameters:
resource - An RDF_Resource
Returns:
An Collection object

getTypes

public org.apache.commons.collections.MultiMap getTypes()
Description copied from interface: IRDF_Namespace
Retrieves all the type relations stored in main memory

Specified by:
getTypes in interface IRDF_Namespace
Returns:
A MultiMap with keys RDF_Resource objects and values collections of RDF_Type objects

getURI

public java.lang.String getURI()
Description copied from interface: IRDF_Namespace
Retrieves the base uri of this namespace

Specified by:
getURI in interface Identifiable
Specified by:
getURI in interface IRDF_Namespace
Returns:
A String

setClasses

public void setClasses(java.util.HashMap classes)
Description copied from interface: IRDF_Namespace
Sets all the classes of this namespace

Specified by:
setClasses in interface IRDF_Namespace
Parameters:
classes - A HashMap of (String)class_uri,RDF_Class pairs

setProperties

public void setProperties(java.util.HashMap properties)
Description copied from interface: IRDF_Namespace
Sets all the properties of this namespace

Specified by:
setProperties in interface IRDF_Namespace
Parameters:
properties - A HashMap of (String)property_uri,RDF_Property pairs

setStatements

public void setStatements(java.util.HashMap statements)
Description copied from interface: IRDF_Namespace
Sets all the statementes of this namespace

Specified by:
setStatements in interface IRDF_Namespace

setSubjects

public void setSubjects(java.util.HashMap<IRDF_Statement,IRDF_Subject> subjects)

setTypes

public void setTypes(org.apache.commons.collections.MultiMap types)

setURI

public void setURI(java.lang.String new_uri)
Description copied from interface: IRDF_Namespace
Sets the base uri of this namespace

Specified by:
setURI in interface Identifiable
Specified by:
setURI in interface IRDF_Namespace
Parameters:
new_uri - A String

addNamespaceDependency

public void addNamespaceDependency(IRDF_Namespace namespace)
Description copied from interface: IRDF_Namespace
Adds a namespace dependency to this namespace

Specified by:
addNamespaceDependency in interface IRDF_Namespace
Parameters:
namespace - An IRDF_Namespace object

getNamespaceDependencies

public java.util.HashMap<java.lang.String,IRDF_Namespace> getNamespaceDependencies()
Description copied from interface: IRDF_Namespace
Gets the namespaces this namespace depends on

Specified by:
getNamespaceDependencies in interface IRDF_Namespace
Returns:
An HashMap object

setNamespaceDependencies

public void setNamespaceDependencies(java.util.HashMap<java.lang.String,IRDF_Namespace> dependencies)
Description copied from interface: IRDF_Namespace
Sets the namespaces this namespace depends on

Specified by:
setNamespaceDependencies in interface IRDF_Namespace
Parameters:
dependencies - An HashMap object

castClassToMetaClass

protected IRDF_MetaClass castClassToMetaClass(IRDF_Model model,
                                              IRDF_Class rdf_class,
                                              int kind)
Casting a Class into MetaClass. Essentially a Class is copied into a MetaClass and then is deleted

Parameters:
rdf_class -
kind -
Returns:

read_triple

public int read_triple(java.lang.String subject,
                       java.lang.String predicate,
                       java.lang.String object,
                       Position pos,
                       java.lang.String graphspace_uri,
                       boolean strict,
                       RDF_Model model)
This method reads and tries to consume a triple created by a parser If the triple is not consumed(is not a schema definition triple) it returns false return 0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)


enter_property

protected int enter_property(java.lang.String subject,
                             java.lang.String predicate,
                             java.lang.String object,
                             Position pos,
                             java.lang.String graphspace_uri,
                             boolean strict,
                             RDF_Model model)
Returns:
0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)

enter_s_p_o

protected int enter_s_p_o(int i,
                          java.lang.String subject,
                          java.lang.String object,
                          Position pos,
                          RDF_Model model,
                          java.lang.String graphspace_uri,
                          boolean strict)
                   throws java.util.NoSuchElementException
Parameters:
i -
subject -
object -
pos -
model -
graphspace_uri -
strict -
Returns:
0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)
Throws:
java.util.NoSuchElementException

enter_label

protected int enter_label(java.lang.String subject,
                          java.lang.String predicate,
                          java.lang.String object,
                          Position pos,
                          RDF_Model model,
                          java.lang.String graphspace_uri,
                          boolean strict)
Parameters:
subject -
predicate -
object -
pos -
model -
graphspace_uri -
strict -
Returns:
0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)

enter_comment

protected int enter_comment(java.lang.String subject,
                            java.lang.String predicate,
                            java.lang.String object,
                            Position pos,
                            RDF_Model model,
                            java.lang.String graphspace_uri,
                            boolean strict)
This method handles the comments on schema resources like classes,properties,etc The comments on class instances are handled by other method

Returns:
0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)

enter_isDefinedBy

protected int enter_isDefinedBy(java.lang.String subject,
                                java.lang.String predicate,
                                java.lang.String object,
                                Position pos,
                                RDF_Model model,
                                java.lang.String graphspace_uri,
                                boolean strict)
Parameters:
subject -
predicate -
object -
pos -
model -
graphspace_uri -
strict -
Returns:
0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)

enter_seeAlso

protected int enter_seeAlso(java.lang.String subject,
                            java.lang.String predicate,
                            java.lang.String object,
                            Position pos,
                            RDF_Model model,
                            java.lang.String graphspace_uri,
                            boolean strict)
Parameters:
subject -
predicate -
object -
pos -
model -
graphspace_uri -
strict -
Returns:
0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)

enter_range

protected int enter_range(java.lang.String subject,
                          java.lang.String predicate,
                          java.lang.String object,
                          Position pos,
                          RDF_Model model,
                          java.lang.String graphspace_uri,
                          boolean strict)
                   throws gr.forth.ics.rdfsuite.services.exceptions.ParsingException
Parameters:
subject -
predicate -
object -
pos -
model -
graphspace_uri -
strict -
Returns:
0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)
Throws:
gr.forth.ics.rdfsuite.services.exceptions.ParsingException - In case a namesapce cannot be stored with neither the rdf/xml nor the trig parser

enter_domain

protected int enter_domain(java.lang.String subject,
                           java.lang.String predicate,
                           java.lang.String object,
                           Position pos,
                           RDF_Model model,
                           java.lang.String graphspace_uri,
                           boolean strict)
                    throws gr.forth.ics.rdfsuite.services.exceptions.ParsingException
Parameters:
subject -
predicate -
object -
pos -
model -
graphspace_uri -
strict -
Returns:
0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)
Throws:
gr.forth.ics.rdfsuite.services.exceptions.ParsingException - in case a namespace cannot be parsed with neither the rdf/xml nor the trig parser

enter_subPropertyOf

protected int enter_subPropertyOf(java.lang.String subject,
                                  java.lang.String predicate,
                                  java.lang.String object,
                                  Position pos,
                                  RDF_Model model,
                                  java.lang.String graphspace_uri,
                                  boolean strict)
                           throws gr.forth.ics.rdfsuite.services.exceptions.ParsingException
Parameters:
subject -
predicate -
object -
pos -
model -
graphspace_uri -
strict - return 0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)
Throws:
gr.forth.ics.rdfsuite.services.exceptions.ParsingException - in case a namespace cannot be parsed with neither the rdf/xml nor the trig parser

enter_subClassOf

protected int enter_subClassOf(java.lang.String subject,
                               java.lang.String predicate,
                               java.lang.String object,
                               Position pos,
                               IRDF_Model model,
                               java.lang.String graphspace_uri,
                               boolean strict)
                        throws gr.forth.ics.rdfsuite.services.exceptions.ParsingException
Parameters:
subject -
predicate -
object -
pos -
model -
graphspace_uri -
strict -
Returns:
0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)
Throws:
gr.forth.ics.rdfsuite.services.exceptions.ParsingException - in case a namespace cannot be parsed with neither the rdf/xml nor the trig parser

enter_type

protected int enter_type(java.lang.String subject,
                         java.lang.String predicate,
                         java.lang.String object,
                         Position pos,
                         java.lang.String graphspace_uri,
                         boolean strict,
                         RDF_Model model)
                  throws gr.forth.ics.rdfsuite.services.exceptions.ParsingException
Parameters:
subject -
predicate -
object -
pos -
graphspace_uri -
strict - If true all the necessary checks will be performed while if it is false we will perform a good will building
Returns:
0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)
Throws:
gr.forth.ics.rdfsuite.services.exceptions.ParsingException - in case a namespace cannot be parsed with neither the rdf/xml nor the trig parser

enter_type_case_object_rdfschema_class

protected void enter_type_case_object_rdfschema_class(java.lang.String subject,
                                                      Position pos,
                                                      java.lang.String graphspace_uri,
                                                      IRDF_Model model,
                                                      IRDF_Namespace triple_namespace,
                                                      boolean inferred)
Note that this namespace is not necessarily the same with subject's namespace


getOrCreateTypeTriple

protected IRDF_Type getOrCreateTypeTriple(IRDF_Model model,
                                          IRDF_Resource subject_resource,
                                          IRDF_Resource object_resource,
                                          IRDF_Namespace namespace,
                                          boolean inferred)
If a type triple for subject resource with type the object_resource already exists it retrieves it or else if object_resource is null checks for a type triple with any object or else creates a new one


getOrCreateSubClassTriple

protected IRDF_SubClass getOrCreateSubClassTriple(IRDF_Model model,
                                                  IRDF_Class subject_class,
                                                  IRDF_Class object_class,
                                                  IRDF_Namespace subject_namespace,
                                                  boolean inferred)
If a subclass triple for subject class and object_class already exists it retrieves it ore else it creates a new one


getOrCreateCommentTriple

protected IRDF_Comment getOrCreateCommentTriple(IRDF_Model model,
                                                IRDF_Resource subject_resource,
                                                IRDF_Literal comment,
                                                IRDF_Namespace subject_namespace,
                                                boolean inferred)
If a subclass triple for subject class and object_class already exists it retrieves it ore else it creates a new one


getOrCreateLabelTriple

protected IRDF_Label getOrCreateLabelTriple(IRDF_Model model,
                                            IRDF_Resource subject_resource,
                                            IRDF_Literal label,
                                            IRDF_Namespace subject_namespace,
                                            boolean inferred)
If a subclass triple for subject class and object_class already exists it retrieves it ore else it creates a new one


getOrCreateSeeAlsoTriple

protected IRDF_SeeAlso getOrCreateSeeAlsoTriple(IRDF_Model model,
                                                IRDF_Resource subject_class,
                                                IRDF_Resource seealso,
                                                IRDF_Namespace subject_namespace,
                                                boolean inferred)
If a subclass triple for subject class and object_class already exists it retrieves it ore else it creates a new one


getOrCreateIsDefinedByTriple

protected IRDF_IsDefinedBy getOrCreateIsDefinedByTriple(IRDF_Model model,
                                                        IRDF_Resource subject_resource,
                                                        IRDF_Resource isdefinedby,
                                                        IRDF_Namespace subject_namespace,
                                                        boolean inferred)
If a subclass triple for subject class and object_class already exists it retrieves it ore else it creates a new one


getOrCreateSubPropertyTriple

protected IRDF_SubProperty getOrCreateSubPropertyTriple(IRDF_Model model,
                                                        IRDF_Property subject_property,
                                                        IRDF_Property object_property,
                                                        IRDF_Namespace subject_namespace,
                                                        boolean inferred)
If a subproperty triple for subject property and object_property already exists it retrieves it or else it creates a new one


getOrCreateStatementSubjectTriple

protected IRDF_Subject getOrCreateStatementSubjectTriple(IRDF_Model model,
                                                         IRDF_Statement subject_statement,
                                                         IRDF_Resource object_resource,
                                                         IRDF_Namespace subject_namespace,
                                                         boolean inferred)
                                                  throws gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException
If a subproperty triple for subject property and object_property already exists it retrieves it or else it creates a new one

Throws:
gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException - in case something goes wrong in the triple creation

getOrCreateStatementPredicateTriple

protected IRDF_Predicate getOrCreateStatementPredicateTriple(IRDF_Model model,
                                                             IRDF_Statement subject_statement,
                                                             IRDF_Property object_resource,
                                                             IRDF_Namespace subject_namespace,
                                                             boolean inferred)
                                                      throws gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException
If a subproperty triple for subject property and object_property already exists it retrieves it or else it creates a new one

Throws:
gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException - in case something goes wrong with the triple creation

getOrCreateStatementObjectTriple

protected IRDF_Object getOrCreateStatementObjectTriple(IRDF_Model model,
                                                       IRDF_Statement subject_statement,
                                                       java.lang.Object object,
                                                       IRDF_Namespace subject_namespace,
                                                       boolean inferred)
                                                throws gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException
If a subproperty triple for subject property and object_property already exists it retrieves it or else it creates a new one

Throws:
gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException - in case something goes wrong with the triple creation

getOrCreateDomainTriple

protected IRDF_Domain getOrCreateDomainTriple(IRDF_Model model,
                                              IRDF_Property subject_property,
                                              IRDF_Class object_class,
                                              IRDF_Namespace subject_namespace,
                                              boolean inferred)
If a domain triple for subject property and object_class already exists it retrieves it or else it creates a new one


getOrCreateRangeTriple

protected IRDF_Range getOrCreateRangeTriple(IRDF_Model model,
                                            IRDF_Property subject_property,
                                            IRDF_Class object_class,
                                            IRDF_Namespace subject_namespace,
                                            boolean inferred)
If a range triple for subject property and object_class already exists it retrieves it or else it creates a new one


enter_type_case_object_metaclass

protected void enter_type_case_object_metaclass(java.lang.String subject,
                                                IRDF_MetaClass object_metaclass,
                                                Position pos,
                                                java.lang.String graphspace_uri,
                                                RDF_Model model,
                                                IRDF_Namespace triple_namespace,
                                                boolean inferred)
Note that this namespace is not necessarily the same with subject's namespace


enter_type_case_object_resource

protected void enter_type_case_object_resource(java.lang.String subject,
                                               IRDF_Resource object_resource,
                                               Position pos,
                                               java.lang.String graphspace_uri,
                                               RDF_Model model,
                                               IRDF_Namespace triple_namespace,
                                               boolean inferred)
Note that this namespace is not necessarily the same with subject's namespace\ Creating a type triple A type B where we dont know what B is. In this case for bothe A,B RDF_Resource objects will be created as well as a type triple between them


enter_type_case_rdf_property

protected void enter_type_case_rdf_property(java.lang.String subject,
                                            Position pos,
                                            java.lang.String graphspace_uri,
                                            RDF_Model model,
                                            IRDF_Namespace triple_namespace,
                                            boolean inferred)
Note that this namespace is not necessarily the same with subject's namespace


enter_type_case_object_metaproperty

protected void enter_type_case_object_metaproperty(java.lang.String subject,
                                                   IRDF_MetaClass object_metaproperty,
                                                   Position pos,
                                                   java.lang.String graphspace_uri,
                                                   RDF_Model model,
                                                   IRDF_Namespace triple_namespace,
                                                   boolean inferred)
Note that this namespace is not necessarily the same with subject's namespace


enter_type_case_statement

protected void enter_type_case_statement(java.lang.String subject,
                                         Position pos,
                                         java.lang.String graphspace_uri,
                                         RDF_Model model,
                                         IRDF_Namespace triple_namespace,
                                         boolean inferred)

createProperty

protected IRDF_Property createProperty(IRDF_Model model,
                                       java.lang.String property_uri,
                                       Position pos)
Creates an IRDF_Property and adds it to this namespace,as well as performing all other initializations. This method supposes that a check on whether a property with this namespace already exists have already been performed Recall than now more RDF_Resources are not related to graphspaces and any form of relations are retained in the form of RDF_Triple objects

Parameters:
model -
property_uri -
pos -
Returns:

castClassToPropertyAndUpdateReferences

protected void castClassToPropertyAndUpdateReferences(IRDF_Model model,
                                                      java.lang.String property_uri,
                                                      IRDF_Property rdf_property)

createClass

protected IRDF_Class createClass(IRDF_Model model,
                                 java.lang.String class_uri,
                                 Position pos)
Creates an IRDF_Class and adds it to this namespace,as well as performing all other initializations. This method supposes that a check on whether a class with this namespace already exists have already been performed Recall than now more RDF_Resources are not related to graphspaces and any form of relations are retained in the form of RDF_Triple objects The IRDF_Class object returned is already added to the namespace hashmap with classes

Parameters:
model -
subject -
pos -
Returns:

createMetaClassOfClasses

protected IRDF_MetaClass createMetaClassOfClasses(IRDF_Model model,
                                                  java.lang.String meta_class_uri,
                                                  Position pos)
Creates an rdf metaclass but without creating the subclass triple to the rdf schema class which is the actual requirement for a class to be a metaclass

Parameters:
model -
meta_class_uri -
pos -
Returns:

createMetaClassOfProperties

protected IRDF_MetaClass createMetaClassOfProperties(IRDF_Model model,
                                                     java.lang.String meta_class_uri,
                                                     Position pos)
Creates an rdf metaclass but without creating the subclass triple to the rdf schema class which is the actual requirement for a class to be a metaclass

Parameters:
model -
meta_class_uri -
pos -
Returns:

createStatement

protected IRDF_Statement createStatement(RDF_Model model,
                                         java.lang.String statement_uri,
                                         Position pos)
Creates an IRDF_Statement and adds it to this namespace,as well as performing all other initializations. This method supposes that a check on whether a statement with this namespace already exists have already been performed Recall than now more RDF_Resources are not related to graphspaces and any form of relations are retained in the form of RDF_Triple objects

Parameters:
model -
subject -
pos -
Returns:

toTriples

public java.util.Collection toTriples()
Description copied from interface: IRDF_Namespace
Returns a collection of triples where each triple is represented by a collection of 3 string values, subject predicate object

Specified by:
toTriples in interface IRDF_Namespace
Returns:
A Collection> object

toString

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

getModel

public IRDF_Model getModel()
Specified by:
getModel in interface IRDF_Namespace

getTriples

public java.util.Collection<IRDF_Triple> getTriples()
Description copied from interface: IRDF_Namespace
Returns a Collection of all triples correlated to this namespace

Specified by:
getTriples in interface IRDF_Namespace
Returns:
A Collection

removeSubClassTriplesOf

protected void removeSubClassTriplesOf(IRDF_Class rdf_class)