org.openprovenance.jena
Class TripleStore

java.lang.Object
  extended by org.openprovenance.jena.TripleStore

public class TripleStore
extends Object

A class to set up a Jena triple store and a pellet reasoner + a some helper functions. This code is inspired by Clark & Parsia example to use Pellet with Jena, and by an IBM example to write sparql queries in Jena.


Field Summary
static String OPMO_NS
           
static String OPMV_NS
           
 
Constructor Summary
TripleStore()
           
 
Method Summary
 com.hp.hpl.jena.rdf.model.Model getModel()
           
 Querier getQuerier()
           
 void loadOPMOOntology()
           
 void loadOPMVOntology()
           
static void printIterator(Iterator<?> i, String header)
           
 void readFile(String url, String lang)
           
 void readFiles(String[] urls, String lang)
           
 void readResource(String name, String base, String lang)
           
 void runQueryAndFormatResult(String queryString)
           
 void setUp()
           
 Querier setUpReasonerForFile(String file, String lang, String prefix, String ns)
          Initializes reasoner with OPMV and OPMO ontology, and loads rdf file.
 com.hp.hpl.jena.reasoner.ValidityReport validate()
           
 void write(OutputStream os)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPMO_NS

public static String OPMO_NS

OPMV_NS

public static String OPMV_NS
Constructor Detail

TripleStore

public TripleStore()
Method Detail

setUp

public void setUp()

setUpReasonerForFile

public Querier setUpReasonerForFile(String file,
                                    String lang,
                                    String prefix,
                                    String ns)
Initializes reasoner with OPMV and OPMO ontology, and loads rdf file.

Parameters:
file - url to file
lang - rdf language
prefix - prefix
ns - namespace
Returns:
Querier object

readFile

public void readFile(String url,
                     String lang)

readFiles

public void readFiles(String[] urls,
                      String lang)

readResource

public void readResource(String name,
                         String base,
                         String lang)

printIterator

public static void printIterator(Iterator<?> i,
                                 String header)

validate

public com.hp.hpl.jena.reasoner.ValidityReport validate()

getModel

public com.hp.hpl.jena.rdf.model.Model getModel()

loadOPMVOntology

public void loadOPMVOntology()

loadOPMOOntology

public void loadOPMOOntology()

runQueryAndFormatResult

public void runQueryAndFormatResult(String queryString)

write

public void write(OutputStream os)

getQuerier

public Querier getQuerier()


Copyright © 2011. All Rights Reserved.