GeezerVison is showing github.com — @type is written as expanded IRI when using a class declared in the dataset · Issue #329 · jsonld-java/jsonld-java
@type is written as expanded IRI when using a class declared in the dataset #329
Description
Via eclipse-rdf4j/rdf4j#3643
Using 0.13.4, when I have a RDFDataset that has a statement declaring a Class and another statement declaring an individual of that class, the individual has the incorrect rdf:type.
JsonLdOptions opts = new JsonLdOptions();
opts.setUseRdfType(Boolean.FALSE);
RDFDataset rdf = new RDFDataset();
rdf.addTriple(
"http://test.com/ontology#Class1",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
"http://www.w3.org/2002/07/owl#Class");
rdf.addTriple(
"http://test.com/ontology#Individual1",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
"http://test.com/ontology#Class1");
System.out.println(JsonUtils.toPrettyString(new JsonLdApi(opts).fromRDF(rdf)));
produces:
[ {
"@id" : "http://test.com/ontology#Class1",
"@type" : [ "http://www.w3.org/2002/07/owl#Class" ]
}, {
"@id" : "http://test.com/ontology#Individual1",
"http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ {
"@id" : "http://test.com/ontology#Class1"
} ]
} ]
I would expect the format of the individual to be:
{
"@id" : "http://test.com/ontologyIndividual1",
"@type" : [ "http://test.com/ontology#Class1" ]
}
Activity
daltontc commented on Jan 25, 2022
From testing, it appears it was introduced in 0.12.3
dr0i commented on Mar 4, 2022
First of all, thx for the issue and the PR! While I think your expectations make sense in general there is a problem with your proposed solution. Going to comment the PR.
dr0i commented on Mar 4, 2022
Metadata
Metadata
Development
No branches or pull requestsIssue actions