edu.stanford.smi.protegex.owl.jena.protege2jena
Class Protege2Jena

java.lang.Object
  extended byedu.stanford.smi.protegex.owl.jena.protege2jena.Protege2Jena

public class Protege2Jena
extends Object

An object that can convert an OWLModel into an OntModel. This implementation uses the OWLModel's TripleStore and creates corresponding Jena triples for each.

When completed, this will replace the JenaCreator class.

Author:
Holger Knublauch

Field Summary
private  com.hp.hpl.jena.rdf.model.Model dummyModel
          A temporary Model which is used to create properties without having to define them with the correct type each time
private  Collection fillTripleStores
           
private  com.hp.hpl.jena.ontology.OntModel ontModel
          The target OntModel
private  OWLModel owlModel
          The source OWLModel
private static String TEMP_SUFFIX
           
private  Map tripleStore2Model
          A Map from TripleStores to Jena Models
private  TripleStoreModel tripleStoreModel
           
 
Constructor Summary
private Protege2Jena(OWLModel owlModel, com.hp.hpl.jena.ontology.OntModel ontModel, Collection fillTripleStores, Map tripleStore2Model)
           
 
Method Summary
private  void copyTriples(TripleStore tripleStore, com.hp.hpl.jena.rdf.model.Model model)
           
private  void createNamespacePrefixes(TripleStore tripleStore, com.hp.hpl.jena.rdf.model.Model model)
           
static com.hp.hpl.jena.ontology.OntModel createOntModel(OWLModel owlModel)
           
static com.hp.hpl.jena.ontology.OntModel createOntModel(OWLModel owlModel, Collection fillTripleStores)
           
static com.hp.hpl.jena.ontology.OntModel createOntModel(OWLModel owlModel, Collection fillTripleStores, Map tripleStores2Model)
           
static com.hp.hpl.jena.ontology.OntModel createOntModel(OWLModel owlModel, com.hp.hpl.jena.ontology.OntModelSpec spec, Collection fillTripleStores)
           
static com.hp.hpl.jena.ontology.OntModel createOntModel(OWLModel owlModel, com.hp.hpl.jena.ontology.OntModelSpec spec, Collection fillTripleStores, Map tripleStore2Model)
           
private  com.hp.hpl.jena.rdf.model.Statement createStatement(Triple triple, com.hp.hpl.jena.rdf.model.Model model)
           
private  com.hp.hpl.jena.rdf.model.Model createSubModel(TripleStore tripleStore)
           
private  void createSubModels()
           
private  void fillModels()
           
private  com.hp.hpl.jena.rdf.model.Model getModel(TripleStore tripleStore)
           
protected static Set getParseTypeCollectionProperties()
           
private  com.hp.hpl.jena.rdf.model.Property getProperty(RDFProperty rdfProperty, com.hp.hpl.jena.rdf.model.Model model)
           
private  com.hp.hpl.jena.rdf.model.RDFNode getRDFNode(Object object, com.hp.hpl.jena.rdf.model.Model model)
           
private  com.hp.hpl.jena.rdf.model.Resource getResource(RDFResource rdfResource, com.hp.hpl.jena.rdf.model.Model model)
           
static void removeRedundantRDFLists(com.hp.hpl.jena.rdf.model.Model model)
          In several contexts, such as owl:unionOf operands, it is unusual to have typed rdf:Lists.
private static void removeRedundantRDFListsRecursively(com.hp.hpl.jena.rdf.model.Resource list)
           
private  void removeRedundantRDFSDomains(com.hp.hpl.jena.rdf.model.Model model)
           
private  void removeRedundantRDFSSubClassOfEquivalentClasses(com.hp.hpl.jena.rdf.model.Model model)
           
private  void removeRedundantRDFSSubClassOfOWLThings(com.hp.hpl.jena.rdf.model.Model model)
           
static void saveAll(OWLModel owlModel, URI uri)
           
static void saveAll(OWLModel owlModel, URI uri, String language)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dummyModel

private com.hp.hpl.jena.rdf.model.Model dummyModel
A temporary Model which is used to create properties without having to define them with the correct type each time


fillTripleStores

private Collection fillTripleStores

owlModel

private OWLModel owlModel
The source OWLModel


ontModel

private com.hp.hpl.jena.ontology.OntModel ontModel
The target OntModel


tripleStore2Model

private Map tripleStore2Model
A Map from TripleStores to Jena Models


tripleStoreModel

private TripleStoreModel tripleStoreModel

TEMP_SUFFIX

private static final String TEMP_SUFFIX
See Also:
Constant Field Values
Constructor Detail

Protege2Jena

private Protege2Jena(OWLModel owlModel,
                     com.hp.hpl.jena.ontology.OntModel ontModel,
                     Collection fillTripleStores,
                     Map tripleStore2Model)
Method Detail

copyTriples

private void copyTriples(TripleStore tripleStore,
                         com.hp.hpl.jena.rdf.model.Model model)

createOntModel

public static com.hp.hpl.jena.ontology.OntModel createOntModel(OWLModel owlModel)

createOntModel

public static com.hp.hpl.jena.ontology.OntModel createOntModel(OWLModel owlModel,
                                                               Collection fillTripleStores)

createOntModel

public static com.hp.hpl.jena.ontology.OntModel createOntModel(OWLModel owlModel,
                                                               Collection fillTripleStores,
                                                               Map tripleStores2Model)

createOntModel

public static com.hp.hpl.jena.ontology.OntModel createOntModel(OWLModel owlModel,
                                                               com.hp.hpl.jena.ontology.OntModelSpec spec,
                                                               Collection fillTripleStores)

createOntModel

public static com.hp.hpl.jena.ontology.OntModel createOntModel(OWLModel owlModel,
                                                               com.hp.hpl.jena.ontology.OntModelSpec spec,
                                                               Collection fillTripleStores,
                                                               Map tripleStore2Model)

createSubModels

private void createSubModels()

createSubModel

private com.hp.hpl.jena.rdf.model.Model createSubModel(TripleStore tripleStore)

createNamespacePrefixes

private void createNamespacePrefixes(TripleStore tripleStore,
                                     com.hp.hpl.jena.rdf.model.Model model)

createStatement

private com.hp.hpl.jena.rdf.model.Statement createStatement(Triple triple,
                                                            com.hp.hpl.jena.rdf.model.Model model)

fillModels

private void fillModels()

getModel

private com.hp.hpl.jena.rdf.model.Model getModel(TripleStore tripleStore)

getParseTypeCollectionProperties

protected static Set getParseTypeCollectionProperties()

getProperty

private com.hp.hpl.jena.rdf.model.Property getProperty(RDFProperty rdfProperty,
                                                       com.hp.hpl.jena.rdf.model.Model model)

getRDFNode

private com.hp.hpl.jena.rdf.model.RDFNode getRDFNode(Object object,
                                                     com.hp.hpl.jena.rdf.model.Model model)

getResource

private com.hp.hpl.jena.rdf.model.Resource getResource(RDFResource rdfResource,
                                                       com.hp.hpl.jena.rdf.model.Model model)

removeRedundantRDFLists

public static void removeRedundantRDFLists(com.hp.hpl.jena.rdf.model.Model model)
In several contexts, such as owl:unionOf operands, it is unusual to have typed rdf:Lists. Typeless rdf:Lists are written out as parseType="Collection". This method detects these rdf:Lists and removes its rdf:type.

Parameters:
model -

removeRedundantRDFListsRecursively

private static void removeRedundantRDFListsRecursively(com.hp.hpl.jena.rdf.model.Resource list)

removeRedundantRDFSDomains

private void removeRedundantRDFSDomains(com.hp.hpl.jena.rdf.model.Model model)

removeRedundantRDFSSubClassOfOWLThings

private void removeRedundantRDFSSubClassOfOWLThings(com.hp.hpl.jena.rdf.model.Model model)

removeRedundantRDFSSubClassOfEquivalentClasses

private void removeRedundantRDFSSubClassOfEquivalentClasses(com.hp.hpl.jena.rdf.model.Model model)

saveAll

public static void saveAll(OWLModel owlModel,
                           URI uri)
                    throws Exception
Throws:
Exception

saveAll

public static void saveAll(OWLModel owlModel,
                           URI uri,
                           String language)
                    throws Exception
Throws:
Exception