Consider the following:
% cat ConceptSchemeName.javaimport org.semanticweb.skosapibinding.SKOSManager;
import org.semanticweb.skos.*;
import java.net.URI;
public class ConceptSchemeName {
public static void main(String[] args) {
SKOSManager manager;
SKOSDataset dataset;
try {
manager = new SKOSManager();
dataset = manager.loadDataset(new URI(args[0]));
for (SKOSConceptScheme scheme : dataset.getSKOSConceptSchemes()) {
System.out.println("Scheme: " + scheme.getURI());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
% cat ConceptSchemeName.ttl
@prefix dc: <http://purl.org/dc/terms/> .
@prefix : <http://www.w3.org/2004/02/skos/core#> .
<> a :ConceptScheme;
dc:created "2009-06-20".
% cat ConceptSchemeName.rdf
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:dc="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2004/02/skos/core#">
<ConceptScheme rdf:about="">
<dc:created>2009-06-20</dc:created>
</ConceptScheme>
</rdf:RDF>
% javac -cp .:../lib/owlapi-bin.jar:../lib/skosapi.jar ConceptSchemeName.java
% java -cp .:../lib/owlapi-bin.jar:../lib/skosapi.jar ConceptSchemeName file:ConceptSchemeName.rdf
Scheme: file:ConceptSchemeName.rdf
% java -cp .:../lib/owlapi-bin.jar:../lib/skosapi.jar ConceptSchemeName file:ConceptSchemeName.ttl
Scheme: file:ConceptSchemeName.ttl#
%
The Turtle and RDF forms are equivalent, but produce different results for the ConceptScheme URI. I believe only the URI parsed from the RDF/XML version is correct.
Amending the .ttl version to include "@base <file:ConceptScheme.ttl>." at the top produces the same effect.
There is of course a potential httpRange-14 issue here -- here, <file:ConceptScheme.ttl> is being a network resource as well as an information resource: but (a) that's my problem, not the API's, (b) if the API feels it _is_ its problem, it should object rather than silently fix, and (c) we shouldn't have different behaviour for the two syntaxes.
Update: just to avoid doubt, the same problem appears if one is explicit about the base URI:
% cat ConceptSchemeName.ttl
@base <urn:example>.
@prefix dc: <http://purl.org/dc/terms/> .
@prefix : <http://www.w3.org/2004/02/skos/core#> .
<> a :ConceptScheme;
dc:created "2009-06-20".
%| cat ConceptSchemeName.rdf
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:dc="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.w3.org/2004/02/skos/core#"
xml:base="urn:example">
<ConceptScheme rdf:about="">
<dc:created>2009-06-20</dc:created>
</ConceptScheme>
</rdf:RDF>
%
And this indicates (doh!) that there isn't an httpRange-14 issue. In the original case, it was purely incidental that the network URI and the name of the ConceptScheme were the same.