fluree / core

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

`false` object values return `invalid-transaction` errors #13

Closed aaj3f closed 1 year ago

aaj3f commented 1 year ago

Description

Using false as an object value on any property returns the following invalid-transaction error:

{
    "spec": "(spec-tools.core/spec {:spec clojure.core/string?, :type :string, :leaf? true})",
    "problems": [
        {
            "path": [],
            "pred": "clojure.core/string?",
            "val": {
                "error": "db/invalid-transaction",
                "message": "JSON-LD value must be a node or a value, instead found ambiguous value: {:value false, :type nil, :idx [\"ex:isCool\"]}"
            },
            "via": [],
            "in": []
        }
    ],
    "type": "reitit.coercion/response-coercion",
    "coercion": "spec",
    "value": {
        "error": "db/invalid-transaction",
        "message": "JSON-LD value must be a node or a value, instead found ambiguous value: {:value false, :type nil, :idx [\"ex:isCool\"]}"
    },
    "in": [
        "response",
        "body"
    ]
}

For example, this transaction produces the above error:

{
    "ledger": "issue/false-bools",
    "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#",
        "schema": "http://schema.org/",
        "f": "https://ns.flur.ee/ledger#"
    },
    "txn": {
        "@id": "ex:andrew",
        "@type": [
            "schema:Person"
        ],
        "ex:isCool": false
    }
}
aaj3f commented 1 year ago

Reference to Nexus issue: https://github.com/fluree/flhubee/issues/208