fluree / core

Fluree releases and public bug reports
0 stars 0 forks source link

`@type` values of `sh:NodeShape` return as `null` in queries #10

Closed aaj3f closed 1 year ago

aaj3f commented 1 year ago

Description

When sh:NodeShape is used as a value on @type, queries of that subject return the @type value as null. Interestingly, in the commit file written to disk, the f:assert value includes "type": "sh:NodeShape"

Creation Transaction 1

{
    "ledger": "issue/null-node-shape",
    "context": {
        "xsd": "http://www.w3.org/2001/XMLSchema#",
        "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
        "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
        "sh": "http://www.w3.org/ns/shacl#",
        "schema": "http://schema.org/",
        "skos": "http://www.w3.org/2008/05/skos#",
        "wiki": "https://www.wikidata.org/wiki/",
        "f": "https://ns.flur.ee/ledger#"
    },
    "txn": {
        "@id": "ex:UserShape",
        "@type": [
            "sh:NodeShape"
        ],
        "sh:targetClass": {
            "@id": "ex:User"
        },
        "sh:property": [
            {
                "sh:path": {
                    "@id": "schema:name"
                },
                "sh:datatype": {
                    "@id": "xsd:string"
                }
            }
        ]
    }
}

Query

{
    "ledger": "issue/null-node-shape",
    "query": {
        "select": {"?s": ["*"]},
        "where": [["?s", "sh:targetClass", "?property"]]
    }
}

Query results

[
    {
        "id": "ex:UserShape",
        "rdf:type": [
            null
        ],
        "sh:targetClass": {
            "id": "ex:User"
        },
        "sh:property": {
            "id": "_:f211106232532993"
        }
    }
]
aaj3f commented 1 year ago

Relates to Nexus ticket: https://github.com/fluree/flhubee/issues/218