Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDF Schema Output: Property-Triple for SaladRecordField missing if jsonldPredicate contains JsonldPredicate instead of Predicate URI ID only #785

Open
stmbaier opened this issue Jan 4, 2024 · 0 comments

Comments

@stmbaier
Copy link

stmbaier commented Jan 4, 2024

Description

If a SALAD Schema contains a SaladRecordField with a jsonldPredicate object instead of a simple string for the predicate URI no Property-Triple is contained anymore in the RDFS output.

Minimal working example

Input schema:

$base: "http://www.example.org/basketSchema
$graph:
  - name: Basket
    type: record
    documentRoot: true
    fields:
      - name: basket
        type:
          type: array
          items: string
        jsonldPredicate: "http://www.example.org/basketSchema#hasProducts"

RDFS Output:

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<http://www.example.org/basketSchema#Basket> a rdfs:Class .

<http://www.example.org/basketSchema#hasProducts> a rdf:Property ;
    rdfs:domain <http://www.example.org/basketSchema#Basket> .

Equivalent not working example

Input schema:

$base: "http://www.example.org/basketSchema"
$graph:
  - name: Basket
    type: record
    documentRoot: true
    fields:
      - name: basket
        type:
          type: array
          items: string
        jsonldPredicate: 
          _id: "http://www.example.org/basketSchema#hasProducts"

RDFS Output:

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

<http://www.example.org/basketSchema#Basket> a rdfs:Class .

Cause Analysis

In the jsonld_context.py in the method process_type in line 142 is, if the jsonldPredicate predicate is an object, erroneously checked for the property "_@id", which is never set.
The pred method used to acquire the predicate object (line 135) re-writes the _idpredicate to @id (line 55) or creates the @id predicate (line 57).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant