ch.hearc.I04_05s08.Ontology.RDF
Class RdfManager

java.lang.Object
  extended bych.hearc.I04_05s08.Ontology.RDF.RdfManager

public class RdfManager
extends Object

A manager for RDF files

Author:
Blanc, Yoan
Licence:
MIT
Copyright:
2005 Yoan Blanc, HE-ARC Ing�nierie

Constructor Summary
RdfManager()
           
 
Method Summary
private static InstanceOfClass buildInstanceOfClass(RdfFile file, Object o)
          Return a class from the rdf file
private static InstanceOfProperty buildInstanceOfProperty(RdfFile file, String name)
          Return a property from the rdf file
static com.hp.hpl.jena.rdf.model.Literal buildLiteral(InstanceOfClass ioc)
          Build a rdf literal
static com.hp.hpl.jena.rdf.model.Model buildModel(RdfFile file)
          Build a model of a rdf file
private static com.hp.hpl.jena.ontology.OntModel buildOntModel(InstanceOfClass c, RdfsFile[] rdfs, com.hp.hpl.jena.ontology.OntModel[] rdfsModel)
          Build the required OntModel (for a rdfsClass)
private static com.hp.hpl.jena.rdf.model.Property buildProperty(InstanceOfProperty iop)
          Build a rdf property
private static com.hp.hpl.jena.rdf.model.Resource buildResource(InstanceOfClass ioc, com.hp.hpl.jena.rdf.model.Resource[] res, com.hp.hpl.jena.rdf.model.Model model, RdfsFile[] rdfs, com.hp.hpl.jena.ontology.OntModel[] rdfsmodel)
          Build a rdf resource
static RdfFile openRdf(String filename, RdfsFile[] rdfs)
          Open a RDF file with RDF Schemas
static String rdfToString(RdfFile file)
          Save a rdf file into a string
static boolean saveRdf(String filename, RdfFile file)
          Save a Rdf file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RdfManager

public RdfManager()
Method Detail

openRdf

public static RdfFile openRdf(String filename,
                              RdfsFile[] rdfs)
Open a RDF file with RDF Schemas

Parameters:
filename - path of the file
rdfs - RDF Schemas (null for not)
Returns:
RDF File

saveRdf

public static boolean saveRdf(String filename,
                              RdfFile file)
Save a Rdf file

Parameters:
filename - path of the output
file - rdf file
Returns:
the state of the operation

rdfToString

public static String rdfToString(RdfFile file)
Save a rdf file into a string

Parameters:
file - the rdf file

buildModel

public static com.hp.hpl.jena.rdf.model.Model buildModel(RdfFile file)
Build a model of a rdf file

Parameters:
file - rdf file
Returns:
the model of the rdf file

buildProperty

private static com.hp.hpl.jena.rdf.model.Property buildProperty(InstanceOfProperty iop)
Build a rdf property

Parameters:
iop - instance of property
Returns:
property

buildLiteral

public static com.hp.hpl.jena.rdf.model.Literal buildLiteral(InstanceOfClass ioc)
Build a rdf literal

Parameters:
ioc - instance of class
Returns:
the resource

buildResource

private static com.hp.hpl.jena.rdf.model.Resource buildResource(InstanceOfClass ioc,
                                                                com.hp.hpl.jena.rdf.model.Resource[] res,
                                                                com.hp.hpl.jena.rdf.model.Model model,
                                                                RdfsFile[] rdfs,
                                                                com.hp.hpl.jena.ontology.OntModel[] rdfsmodel)
Build a rdf resource

Parameters:
ioc - instance of class
res - known resource
model - the model's file
rdfs - the RDF Schemas
rdfsmodel - the rdfs model
Returns:
the resource

buildOntModel

private static com.hp.hpl.jena.ontology.OntModel buildOntModel(InstanceOfClass c,
                                                               RdfsFile[] rdfs,
                                                               com.hp.hpl.jena.ontology.OntModel[] rdfsModel)
Build the required OntModel (for a rdfsClass)

Parameters:
c - the RdfsClass
rdfs - rdfs files
rdfsModel - known Model
Returns:
the model of the rdfsClass

buildInstanceOfClass

private static InstanceOfClass buildInstanceOfClass(RdfFile file,
                                                    Object o)
Return a class from the rdf file

Parameters:
file - rdf file
o - object that is instanciate (Literal of RdfNode)

buildInstanceOfProperty

private static InstanceOfProperty buildInstanceOfProperty(RdfFile file,
                                                          String name)
Return a property from the rdf file

Parameters:
file - rdf file
name - identifier of the property (his url)


A project by Blanc, Yoan – supervised by Dr. Ghorbel, Hatem.
2004 © Blanc, Yoan - HE-ARC