ch.hearc.I04_05s08.Ontology.RDFS
Class RdfsManager

java.lang.Object
  extended bych.hearc.I04_05s08.Ontology.RDFS.RdfsManager

public class RdfsManager
extends Object

A manager for RDF Schema

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

Field Summary
private static RdfsProperty XString
           
 
Constructor Summary
RdfsManager()
           
 
Method Summary
private static RdfsClass buildClass(RdfsFile file, String name)
          Return a class from the rdfs file
static com.hp.hpl.jena.ontology.OntModel buildModel(RdfsFile file)
          Build a model with the RdfsFile
private static RdfsProperty buildProperty(RdfsFile file, String name)
          Return a property from the rdfs file
static RdfsClass getClass(RdfsFile[] rdfs, String name)
          Get a class from some RDFS
private static com.hp.hpl.jena.ontology.OntClass getOntClass(com.hp.hpl.jena.ontology.OntResource[] classes, String uri)
          Get a class from its uri
private static com.hp.hpl.jena.ontology.OntProperty getOntProperty(com.hp.hpl.jena.ontology.OntResource[] props, String uri)
          Get a property from its uri
static RdfsProperty getProperty(RdfsFile[] rdfs, String name)
          Get a property from some RDFS
private static com.hp.hpl.jena.ontology.OntResource getResource(com.hp.hpl.jena.rdf.model.Resource[] resources, String uri)
          Get a resource from its uri
static RdfsFile openRdfs(String filename)
          Build a rdfs file
static String rdfsToString(RdfsFile file)
          Save a rdfs file into a string
private static com.hp.hpl.jena.rdql.QueryResults runQuery(com.hp.hpl.jena.rdf.model.Model model, String query)
          Execute a RDQL query
static boolean saveRdfs(String filename, RdfsFile file)
          Save a rdfs file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XString

private static RdfsProperty XString
Constructor Detail

RdfsManager

public RdfsManager()
Method Detail

saveRdfs

public static boolean saveRdfs(String filename,
                               RdfsFile file)
Save a rdfs file

Parameters:
filename - path of the source file
file - the rdfs file

rdfsToString

public static String rdfsToString(RdfsFile file)
Save a rdfs file into a string

Parameters:
file - the rdfs file

buildModel

public static com.hp.hpl.jena.ontology.OntModel buildModel(RdfsFile file)
Build a model with the RdfsFile

Parameters:
file - the rdfs file
Returns:
the model

getResource

private static com.hp.hpl.jena.ontology.OntResource getResource(com.hp.hpl.jena.rdf.model.Resource[] resources,
                                                                String uri)
Get a resource from its uri

Parameters:
resources - the ontResources
uri - uri that searched
Returns:
the OntRessource with the uri

getOntClass

private static com.hp.hpl.jena.ontology.OntClass getOntClass(com.hp.hpl.jena.ontology.OntResource[] classes,
                                                             String uri)
Get a class from its uri

Parameters:
classes - the ontClasses
uri - uri that searched
Returns:
the OntClass with the uri

getOntProperty

private static com.hp.hpl.jena.ontology.OntProperty getOntProperty(com.hp.hpl.jena.ontology.OntResource[] props,
                                                                   String uri)
Get a property from its uri

Parameters:
props - the ontProperties
uri - uri that searched
Returns:
the OntProperty with the uri

openRdfs

public static RdfsFile openRdfs(String filename)
Build a rdfs file

Parameters:
filename - path of the source file
Returns:
the rdfs file

runQuery

private static com.hp.hpl.jena.rdql.QueryResults runQuery(com.hp.hpl.jena.rdf.model.Model model,
                                                          String query)
Execute a RDQL query

Parameters:
model - current model
query - RDQL query

buildClass

private static RdfsClass buildClass(RdfsFile file,
                                    String name)
Return a class from the rdfs file

Parameters:
file - rdfs file
name - identifier of the class (his url)

buildProperty

private static RdfsProperty buildProperty(RdfsFile file,
                                          String name)
Return a property from the rdfs file

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

getClass

public static RdfsClass getClass(RdfsFile[] rdfs,
                                 String name)
Get a class from some RDFS

Parameters:
rdfs - RDF Schema
name - searched class

getProperty

public static RdfsProperty getProperty(RdfsFile[] rdfs,
                                       String name)
Get a property from some RDFS

Parameters:
rdfs - RDF Schema
name - searched property


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