Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
*.idea
.DS_Store
*.class
*.class
target/
target
.project
.classpath
.settings
2 changes: 1 addition & 1 deletion distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>skos-api</artifactId>
<groupId>skos-api</groupId>
<version>3.1</version>
<version>3.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
Expand All @@ -34,7 +34,7 @@
<groupId>skos-api</groupId>
<artifactId>skos-api</artifactId>
<packaging>pom</packaging>
<version>3.1</version>
<version>3.2-SNAPSHOT</version>
<modules>
<module>skos-core</module>
<module>skos-impl</module>
Expand Down
Binary file modified skos-api-onejar.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion skos-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>skos-api</artifactId>
<groupId>skos-api</groupId>
<version>3.1</version>
<version>3.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions skos-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>skos-api</artifactId>
<groupId>skos-api</groupId>
<version>3.1</version>
<version>3.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -15,7 +15,7 @@
<dependency>
<groupId>skos-api</groupId>
<artifactId>skos-impl</artifactId>
<version>3.1</version>
<version>3.2-SNAPSHOT</version>
</dependency>
</dependencies>

Expand Down
46 changes: 35 additions & 11 deletions skos-example/src/main/java/example/CreateSKOSExample.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
package example;

import org.semanticweb.owlapi.model.*;
import org.semanticweb.owlapi.vocab.DublinCoreVocabulary;
import org.semanticweb.skos.*;
import org.semanticweb.skos.properties.SKOSAltLabelProperty;
import org.semanticweb.skosapibinding.SKOSFormatExt;
import org.semanticweb.skosapibinding.SKOSManager;
import org.semanticweb.skosapibinding.SKOStoOWLConverter;

import java.net.URI;
import java.util.ArrayList;
import java.util.List;
Expand All @@ -34,6 +26,38 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

import org.semanticweb.owlapi.model.AddAxiom;
import org.semanticweb.owlapi.model.OWLDataFactory;
import org.semanticweb.owlapi.model.OWLOntologyChangeException;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.semanticweb.owlapi.model.OWLSubAnnotationPropertyOfAxiom;
import org.semanticweb.owlapi.vocab.DublinCoreVocabulary;
import org.semanticweb.skos.AddAssertion;
import org.semanticweb.skos.SKOSAnnotation;
import org.semanticweb.skos.SKOSAnnotationAssertion;
import org.semanticweb.skos.SKOSAnnotationProperty;
import org.semanticweb.skos.SKOSChange;
import org.semanticweb.skos.SKOSChangeException;
import org.semanticweb.skos.SKOSConcept;
import org.semanticweb.skos.SKOSConceptScheme;
import org.semanticweb.skos.SKOSCreationException;
import org.semanticweb.skos.SKOSDataFactory;
import org.semanticweb.skos.SKOSDataRelationAssertion;
import org.semanticweb.skos.SKOSDataset;
import org.semanticweb.skos.SKOSEntity;
import org.semanticweb.skos.SKOSEntityAssertion;
import org.semanticweb.skos.SKOSLiteral;
import org.semanticweb.skos.SKOSObject;
import org.semanticweb.skos.SKOSObjectRelationAssertion;
import org.semanticweb.skos.SKOSResource;
import org.semanticweb.skos.SKOSStorageException;
import org.semanticweb.skos.SKOSTypedLiteral;
import org.semanticweb.skos.SKOSUntypedLiteral;
import org.semanticweb.skos.properties.SKOSAltLabelProperty;
import org.semanticweb.skosapibinding.SKOSFormatExt;
import org.semanticweb.skosapibinding.SKOSManager;
import org.semanticweb.skosapibinding.SKOStoOWLConverter;

/**
* Author: Simon Jupp<br>
* Date: Mar 4, 2008<br>
Expand Down Expand Up @@ -122,10 +146,10 @@ public static void main(String[] args) throws SKOSCreationException {
* here is an example adding a dc:creator and a rdfs:comment
*/

SKOSAnnotation anno1 = factory.getSKOSAnnotation(DublinCoreVocabulary.DATE.getURI(), "12-07-2008");
SKOSAnnotation anno2 = factory.getSKOSAnnotation(DublinCoreVocabulary.CREATOR.getURI(), "Simon Jupp", "en");
SKOSAnnotation anno1 = factory.getSKOSAnnotation(DublinCoreVocabulary.DATE.getIRI().toURI(), "12-07-2008");
SKOSAnnotation anno2 = factory.getSKOSAnnotation(DublinCoreVocabulary.CREATOR.getIRI().toURI(), "Simon Jupp", "en");
SKOSAnnotation anno3 = factory.getSKOSAnnotation(URI.create("http://my-custom-annotation.com/example"), someResource);
SKOSAnnotation anno4 = factory.getSKOSAnnotation(DublinCoreVocabulary.CREATOR.getURI(), factory.getSKOSUntypedConstant("Simon Jupp", "en"));
SKOSAnnotation anno4 = factory.getSKOSAnnotation(DublinCoreVocabulary.CREATOR.getIRI().toURI(), factory.getSKOSUntypedConstant("Simon Jupp", "en"));
// todo need to work on typed on objects
//factory.getSKOSAnnotationsByURI(DublinCoreVocabulary.CREATOR.getURI(), factory.getSKOSTypedConstant("String", "Simon Jupp"));

Expand Down
23 changes: 12 additions & 11 deletions skos-example/src/main/java/example/Example4.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
package example;

import org.semanticweb.owlapi.model.OWLObjectProperty;
import org.semanticweb.owlapi.model.OWLObjectPropertyExpression;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.skos.SKOSCreationException;
import org.semanticweb.skos.SKOSDataFactory;
import org.semanticweb.skos.SKOSDataset;
import org.semanticweb.skos.SKOSObjectProperty;
import org.semanticweb.skosapibinding.SKOSManager;
import org.semanticweb.skosapibinding.SKOStoOWLConverter;

import java.net.URI;
/*
* Copyright (C) 2007, University of Manchester
Expand All @@ -34,6 +24,17 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

import org.semanticweb.owlapi.model.OWLObjectProperty;
import org.semanticweb.owlapi.model.OWLObjectPropertyExpression;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.search.EntitySearcher;
import org.semanticweb.skos.SKOSCreationException;
import org.semanticweb.skos.SKOSDataFactory;
import org.semanticweb.skos.SKOSDataset;
import org.semanticweb.skos.SKOSObjectProperty;
import org.semanticweb.skosapibinding.SKOSManager;
import org.semanticweb.skosapibinding.SKOStoOWLConverter;

/**
* Author: Simon Jupp<br>
* Date: Aug 26, 2009<br>
Expand All @@ -59,7 +60,7 @@ public static void main(String[] args) {
// get the SKOS dataset as an owl ontology object
OWLOntology onto = conv.getAsOWLOntology(dataset);
//query the owl ontology for superproperties
for (OWLObjectPropertyExpression prop : owlPartOf.getSuperProperties(onto)) {
for (OWLObjectPropertyExpression prop : EntitySearcher.getSuperProperties(owlPartOf, onto)) {
System.out.println(prop.asOWLObjectProperty().getIRI());
}

Expand Down
26 changes: 13 additions & 13 deletions skos-example/src/main/java/example/ReadInferredSKOS.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
package example;

import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.*;
import org.semanticweb.owlapi.reasoner.BufferingMode;
import org.semanticweb.owlapi.reasoner.OWLReasoner;
import org.semanticweb.owlapi.reasoner.OWLReasonerFactory;
import org.semanticweb.skos.*;
import org.semanticweb.skosapibinding.SKOSFormatExt;
import org.semanticweb.skosapibinding.SKOSManager;
import org.semanticweb.skosapibinding.SKOSReasoner;
import org.semanticweb.skosapibinding.SKOStoOWLConverter;

import java.net.URI;
/*
* Copyright (C) 2007, University of Manchester
Expand All @@ -35,6 +24,16 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

import org.semanticweb.owlapi.model.AddImport;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLImportsDeclaration;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.parameters.ChangeApplied;
import org.semanticweb.skos.SKOSCreationException;
import org.semanticweb.skos.SKOSDataset;
import org.semanticweb.skosapibinding.SKOSManager;
import org.semanticweb.skosapibinding.SKOStoOWLConverter;

/**
* Author: Simon Jupp<br>
* Date: Aug 28, 2008<br>
Expand Down Expand Up @@ -95,8 +94,9 @@ public static void main(String[] args) {

OWLImportsDeclaration importsDec = manager.getOWLManger().getOWLDataFactory().getOWLImportsDeclaration(IRI.create ("http://www.w3.org/2004/02/skos/core"));

for (OWLOntologyChange change: manager.getOWLManger().applyChange(new AddImport(mySkosAsOWLOntology, importsDec))) {
System.out.println(change.toString());
AddImport addImport = new AddImport(mySkosAsOWLOntology, importsDec);
if( manager.getOWLManger().applyChange(addImport)==ChangeApplied.SUCCESSFULLY) {
System.out.println(addImport.toString());
}

// SKOSDataset skosCoreOntology = manager.loadDataset(URI.create("http://www.w3.org/2004/02/skos/core"));
Expand Down
8 changes: 4 additions & 4 deletions skos-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>skos-api</artifactId>
<groupId>skos-api</groupId>
<version>3.1</version>
<version>3.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand All @@ -16,13 +16,13 @@
<dependency>
<groupId>skos-api</groupId>
<artifactId>skos-core</artifactId>
<version>3.1</version>
<version>3.2-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-distribution</artifactId>
<version>3.4.10</version>
<artifactId>owlapi-osgidistribution</artifactId>
<version>[4.0.2,4.1)</version>
</dependency>

</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package org.semanticweb.skosapibinding;

import org.coode.owlapi.manchesterowlsyntax.ManchesterOWLSyntaxOntologyFormat;
import org.coode.owlapi.turtle.TurtleOntologyFormat;
import org.semanticweb.owlapi.io.OWLXMLOntologyFormat;
import org.semanticweb.owlapi.io.RDFXMLOntologyFormat;
import org.semanticweb.owlapi.model.OWLOntologyFormat;
import org.semanticweb.owlapi.formats.ManchesterSyntaxDocumentFormatFactory;
import org.semanticweb.owlapi.formats.OWLXMLDocumentFormatFactory;
import org.semanticweb.owlapi.formats.RDFXMLDocumentFormatFactory;
import org.semanticweb.owlapi.formats.TurtleDocumentFormatFactory;
import org.semanticweb.owlapi.model.OWLDocumentFormat;
import org.semanticweb.owlapi.model.OWLDocumentFormatFactory;
import org.semanticweb.skos.SKOSFormat;
import org.semanticweb.skos.SKOSUnkownFormatException;

Expand Down Expand Up @@ -41,37 +42,23 @@ public enum SKOSFormatExt implements SKOSFormat {

// RDFXML(new OWLXMLVocabulary());

RDFXML("RDFXML") ,
RDFXML(new RDFXMLDocumentFormatFactory()) ,

TURTRLE("TURTLE"),
TURTRLE(new TurtleDocumentFormatFactory()),

OWLXML("OWLXML"),
OWLXML(new OWLXMLDocumentFormatFactory()),

MOS("MOS");
MOS(new ManchesterSyntaxDocumentFormatFactory());

private String localName;
private OWLDocumentFormatFactory factory;


SKOSFormatExt(String localname) {
this.localName = localname;
SKOSFormatExt(OWLDocumentFormatFactory factory) {
this.factory=factory;
}


public OWLOntologyFormat getFormat() throws SKOSUnkownFormatException {

if (localName.equals("RDFXML")) {
return new RDFXMLOntologyFormat();
}
else if (localName.equals("OWLXML")) {
return new OWLXMLOntologyFormat();
}
else if (localName.equals("MOS")) {
return new ManchesterOWLSyntaxOntologyFormat();
}
else if (localName.equals("TURTLE")) {
return new TurtleOntologyFormat();
}

throw new SKOSUnkownFormatException("Unknown format: " + localName);
public OWLDocumentFormat getFormat() throws SKOSUnkownFormatException {
return factory.createFormat();
}
}
Loading