GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

New issue
Copy link
New issue
Copy link
Open
Open
@type is written as expanded IRI when using a class declared in the dataset#329
Copy link

Description

@daltontc
daltontc
opened on Jan 25, 2022
Issue body actions

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

  1. daltontc commented on Jan 25, 2022

    @daltontc
    daltontc
    on Jan 25, 2022
    Author
    More actions

    From testing, it appears it was introduced in 0.12.3

  2. dr0i commented on Mar 4, 2022

    @dr0i
    dr0i
    on Mar 4, 2022
    Member
    More actions

    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.

  3. dr0i commented on Mar 4, 2022

    @dr0i
    dr0i
    on Mar 4, 2022
    Member
    More actions

    Related to #242.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.