Skip to content

Commit

Permalink
fixed bug where language tags were not being set on plain literals
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjupp committed Feb 27, 2014
1 parent adc064a commit d680edd
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion skos-example/src/main/java/example/CreateSKOSExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public static void main(String[] args) throws SKOSCreationException {
man.applyChanges(addList);

System.err.println("writing ontology");
man.save(vocab, SKOSFormatExt.RDFXML, URI.create("file:/Users/jupp/tmp/testskos.rdf"));
man.save(vocab, SKOSFormatExt.RDFXML, URI.create("file:/Users/jupp/tmp/testskos/testskos.rdf"));

} catch (SKOSChangeException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
Expand Down
9 changes: 6 additions & 3 deletions skos-example/src/main/java/example/ReadSKOSExample.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package example;

import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.*;
import org.semanticweb.skos.*;
import org.semanticweb.skosapibinding.SKOSManager;
import org.semanticweb.skosapibinding.SKOStoOWLConverter;

import java.net.URI;
import java.util.HashSet;
import java.util.Set;

/*
* Copyright (C) 2007, University of Manchester
Expand Down Expand Up @@ -46,7 +47,9 @@ public ReadSKOSExample() {
final SKOSManager man = new SKOSManager();
//
SKOSDataset dataSet = man.loadDatasetFromPhysicalURI(URI.create("file:/Users/simon/ontologies/skos/agrovoc_2007_SKOS/ag_skos_20070219.rdf"));
//

//////

// print out all concepts;
for (SKOSConcept concept : dataSet.getSKOSConcepts()) {
System.out.println("Concept: " + concept.getURI());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public SKOSUntypedLiteralImpl(OWLDataFactory factory, String literal, String lan
this.lang = lang;
this.literal = literal;
if (lang == null) {
this.constant = factory.getOWLStringLiteral(literal);
this.constant = factory.getOWLLiteral(literal);
}
else {
this.constant = factory.getOWLStringLiteral(literal, lang);
this.constant = factory.getOWLLiteral(literal, lang);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public SKOSAnnotationImpl (OWLDataFactory factory, URI uri, SKOSLiteral literal)
}
else {
owlAnnotation = factory.getOWLAnnotation(
factory.getOWLAnnotationProperty(IRI.create(uri)), factory.getOWLLiteral(owlLiteral.getLiteral(), OWL2Datatype.RDF_XML_LITERAL));
factory.getOWLAnnotationProperty(IRI.create(uri)), owlLiteral);

}

Expand Down

0 comments on commit d680edd

Please sign in to comment.