From: <lor...@us...> - 2011-08-17 10:58:31
|
Revision: 3058 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=3058&view=rev Author: lorenz_b Date: 2011-08-17 10:58:25 +0000 (Wed, 17 Aug 2011) Log Message: ----------- Added more enrichment vocabulary. Modified Paths: -------------- trunk/components-core/src/main/java/org/dllearner/utilities/EnrichmentVocabulary.java trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java Modified: trunk/components-core/src/main/java/org/dllearner/utilities/EnrichmentVocabulary.java =================================================================== --- trunk/components-core/src/main/java/org/dllearner/utilities/EnrichmentVocabulary.java 2011-08-17 09:25:45 UTC (rev 3057) +++ trunk/components-core/src/main/java/org/dllearner/utilities/EnrichmentVocabulary.java 2011-08-17 10:58:25 UTC (rev 3058) @@ -30,7 +30,11 @@ public static final OWLClass AlgorithmRun = factory.getOWLClass(IRI.create(NS + "AlgorithmRun")); + public static final OWLClass SPARQLEndpoint = factory.getOWLClass(IRI.create(NS + "SPARQL_Endpoint")); + public static final OWLClass OWLFile = factory.getOWLClass(IRI.create(NS + "OWL_File")); + + //the object properties public static final OWLObjectProperty creator = factory.getOWLObjectProperty(IRI.create(NS + "creator")); @@ -46,7 +50,9 @@ public static final OWLObjectProperty usedAlgorithm = factory.getOWLObjectProperty(IRI.create(NS + "usedAlgorithm")); + public static final OWLObjectProperty defaultGraph = factory.getOWLObjectProperty(IRI.create(NS + "defaultGraph")); + //the data properties public static final OWLDataProperty confidence = factory.getOWLDataProperty(IRI.create(NS + "confidence")); Modified: trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java =================================================================== --- trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java 2011-08-17 09:25:45 UTC (rev 3057) +++ trunk/interfaces/src/main/java/org/dllearner/cli/Enrichment.java 2011-08-17 10:58:25 UTC (rev 3058) @@ -110,6 +110,7 @@ import org.semanticweb.owlapi.model.OWLAxiom; import org.semanticweb.owlapi.model.OWLDataFactory; import org.semanticweb.owlapi.model.OWLIndividual; +import org.semanticweb.owlapi.model.OWLNamedIndividual; import org.semanticweb.owlapi.model.OWLOntology; import org.semanticweb.owlapi.model.OWLOntologyCreationException; import org.semanticweb.owlapi.model.OWLOntologyManager; @@ -401,22 +402,29 @@ f.getOWLLiteral(algorithmName)); ax = f.getOWLAnnotationAssertionAxiom(algorithmInd.asOWLNamedIndividual().getIRI(), labelAnno); axioms.add(ax); + //add version to algorithm + //TODO //add algorithm instance to algorithm run instance ax = f.getOWLObjectPropertyAssertionAxiom(EnrichmentVocabulary.usedAlgorithm, algorithmRunInd, algorithmInd); axioms.add(ax); //add Parameters to algorithm run instance //TODO - //add used input to algorithm run instance try { + OWLNamedIndividual knowldegeBaseInd = f.getOWLNamedIndividual(IRI.create(ks.getEndpoint().getURL())); + ax = f.getOWLClassAssertionAxiom(EnrichmentVocabulary.SPARQLEndpoint, knowldegeBaseInd); + axioms.add(ax); + ax = f.getOWLObjectPropertyAssertionAxiom(EnrichmentVocabulary.defaultGraph, knowldegeBaseInd, f.getOWLNamedIndividual(IRI.create(ks.getEndpoint().getDefaultGraphURIs().iterator().next()))); + axioms.add(ax); ax = f.getOWLObjectPropertyAssertionAxiom(EnrichmentVocabulary.hasInput, - algorithmRunInd, f.getOWLNamedIndividual(IRI.create(ks.getEndpoint().getURL()))); + algorithmRunInd, knowldegeBaseInd); + axioms.add(ax); } catch (URISyntaxException e1) { e1.printStackTrace(); } - axioms.add(ax); + //add algorithm run instance to suggestion set instance via ObjectProperty creator ax = f.getOWLObjectPropertyAssertionAxiom(EnrichmentVocabulary.creator, ind, algorithmRunInd); @@ -450,6 +458,7 @@ ManchesterOWLSyntaxOntologyFormat manSyntaxFormat = new ManchesterOWLSyntaxOntologyFormat(); manSyntaxFormat.setDefaultPrefix(defaultNamespace); + manSyntaxFormat.setPrefix("enrichment", "http://www.dl-learner.org/enrichment.owl#"); OWLOntologyManager man = OWLManager.createOWLOntologyManager(); OWLOntology ontology = man.createOntology(new HashSet<OWLAxiom>(axioms), IRI.create(defaultNamespace + "enrichment")); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |