org.eaglei.datatools.jena
Class EIInstanceFactory

java.lang.Object
  extended by org.eaglei.datatools.jena.EIInstanceFactory

public class EIInstanceFactory
extends java.lang.Object

Author:
Daniela Bourges-Waldegg, Ricardo De Lima April 11, 2010 Center for Biomedical Informatics (CBMI)

Field Summary
static EIInstanceFactory INSTANCE
           
 
Method Summary
 com.hp.hpl.jena.rdf.model.Model convertToJenaModel(org.eaglei.model.EIInstance instance)
           
 org.eaglei.model.EIInstance create(org.eaglei.model.EIURI instanceUri, com.hp.hpl.jena.rdf.model.Model model)
          Create an EIInstance from a Jena model, with a given instanceUri
 org.eaglei.model.EIInstance create(org.eaglei.model.EIURI instanceUri, java.lang.String rdf, java.lang.String lang)
          Create an EIInstance from an RDF String serialization in one of the RDF languages supported by Jena
 java.util.List<org.eaglei.model.EIInstance> create(com.hp.hpl.jena.rdf.model.Model model)
          Batch creation of a list of EIInstances from a model
 java.util.List<org.eaglei.model.EIInstance> create(com.hp.hpl.jena.query.ResultSet resultSet)
          Create method for abridged EIInstances (label, type, owner, WFState, creation date)
 org.eaglei.model.EIInstance createEmpty(org.eaglei.model.EIURI typeUri, org.eaglei.model.EIEntity instanceEntity)
          Create an EIInstance with no properties other than an eiType (at least one type must be set)
static EIInstanceFactory getInstance()
           
 java.lang.String serialize(org.eaglei.model.EIInstance instance, java.lang.String lang)
          Serialize an EInstance into an RDF language
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final EIInstanceFactory INSTANCE
Method Detail

getInstance

public static EIInstanceFactory getInstance()

serialize

public java.lang.String serialize(org.eaglei.model.EIInstance instance,
                                  java.lang.String lang)
Serialize an EInstance into an RDF language

Parameters:
instance -
lang - - one of the RDF languages supported by Jena; predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE", "TURTLE", (and "TTL") and "N3". The default value, represented by null is "RDF/XML".
Returns:
- the serialized EIInstance as a STring

convertToJenaModel

public com.hp.hpl.jena.rdf.model.Model convertToJenaModel(org.eaglei.model.EIInstance instance)

create

public org.eaglei.model.EIInstance create(org.eaglei.model.EIURI instanceUri,
                                          java.lang.String rdf,
                                          java.lang.String lang)
Create an EIInstance from an RDF String serialization in one of the RDF languages supported by Jena

Parameters:
instanceUri - - the instance uri (all the triples in the rdf parameter should have it as subject)
rdf -
lang -
Returns:

createEmpty

public org.eaglei.model.EIInstance createEmpty(org.eaglei.model.EIURI typeUri,
                                               org.eaglei.model.EIEntity instanceEntity)
Create an EIInstance with no properties other than an eiType (at least one type must be set)

Parameters:
typeUri - - type of the EInstance; if more than one, add can be used
instanceEntity - - entity containing the instance Uri and its label
Returns:
null if the typeUri is not an EI Class

create

public org.eaglei.model.EIInstance create(org.eaglei.model.EIURI instanceUri,
                                          com.hp.hpl.jena.rdf.model.Model model)
Create an EIInstance from a Jena model, with a given instanceUri

Parameters:
instanceUri - - the instance uri (all the triples in the model should have it as subject)
model -
Returns:

create

public java.util.List<org.eaglei.model.EIInstance> create(com.hp.hpl.jena.rdf.model.Model model)
Batch creation of a list of EIInstances from a model

Parameters:
model -
Returns:

create

public java.util.List<org.eaglei.model.EIInstance> create(com.hp.hpl.jena.query.ResultSet resultSet)
Create method for abridged EIInstances (label, type, owner, WFState, creation date)

Parameters:
resultSet -
Returns:


Copyright © 2009-2010 Eagle-I. All Rights Reserved.