Created
February 13, 2017 23:28
-
-
Save GiovanniBalestrieri/f144ef9690080971d6c9a8b441d5e34c to your computer and use it in GitHub Desktop.
loading an onotlogy into memory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final String JENA_PATH = "/home/PATH/ontologies/"; | |
final String SOURCE = "http://www.semanticweb.org/ontologies/2016/1/"; | |
final String TBOX_FILE = "semantic_mapping_domain_model.owl"; | |
final String ABOX_FILE = "semantic_map1.owl"; | |
/** | |
* Importing Tbox | |
*/ | |
OntModel tbox = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM ); | |
OntDocumentManager dm_tbox = tbox.getDocumentManager(); | |
dm_tbox.addAltEntry(SOURCE+TBOX_FILE,"file:"+TBOX_FILE); | |
tbox.read(SOURCE+TBOX_FILE,"RDF/XML"); | |
/** | |
* Importing Abox | |
*/ | |
OntModel abox = ModelFactory.createOntologyModel( OntModelSpec.OWL_MEM); | |
OntDocumentManager dma = abox.getDocumentManager(); | |
dma.addAltEntry( SOURCE + ABOX_FILE , "file:" + ABOX_FILE); | |
abox.read(SOURCE + ABOX_FILE,"RDF/XML"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment