sparna-git / Sparnatural

Sparnatural : Typescript visual SPARQL query builder for knowledge graphs, configurable with SHACL
http://sparnatural.eu
GNU Lesser General Public License v3.0
206 stars 34 forks source link

SHACL blank node paths not implemented #602

Closed CFGrote closed 3 weeks ago

CFGrote commented 3 weeks ago

I get a Uncaught Error: SHACL blank node paths not implemented yet from this shape in my shacl config:

shapes:SIO_001166
    sh:name      "annotation"@en ;
    sh:nodeKind  sh:Literal ;
    sh:node       shapes:Go_term ;
    sh:path      (<http://semanticscience.org/resource/SIO_001166> <http://www.w3.org/ns/hydra/core#member>).

Just wondering if there's a major obstacle to implement this or just not prioritized yet? The same path works well in a owl config generated with protege following the tutorial. I'm glad to help out if needed, some instructions where to get started would be appreciated.

tfrancart commented 3 weeks ago

Which version are you using ? can you try with the latest 9.0.1 release, as some bug fixes have been done in SHACL property path handling : https://github.com/sparna-git/Sparnatural/releases/tag/9.0.1

CFGrote commented 3 weeks ago

I'm on 9.0.1 (a0c07f6093155cf5d704f1c7024a7f9cb7acbe7a to be precise).

More specifically, the target class ("Go_term") is shown in the graphical query editor, but I cannot add properties or click "any". Hope this screenshot is illustrative enough: image

tfrancart commented 3 weeks ago

This has been implemented last march : https://github.com/sparna-git/Sparnatural/commit/c6e98a And this is included in the 9.0.1 release. Please double check, refresh browser, etc.

CFGrote commented 3 weeks ago

I rebuilt sparnatural ('npm run build') and copied the artifacts to my project next to the index.html file. Refreshed browser. The reported error is gone, now, but I get

Uncaught TypeError: this.store.getQuads(...)[0] is undefined
    getLabel SHACLSpecificationProperty.ts:31
    sort SHACLSpecificationEntry.ts:99
    sort SHACLSpecificationEntry.ts:63
    getProperties SHACLSpecificationEntity.ts:154
    getConnectedEntities SHACLSpecificationEntity.ts:92
    buildSelect_EndClassGroup ClassTypeId.ts:180
    render ClassTypeId.ts:65
    onStartClassGroupSelected EndClassGroup.ts:42
    Un CriteriaGroup.ts:83
    $r StartClassGroup.ts:105
    Mr StartClassGroup.ts:58
    z SelectViewVariableBtn.ts:64
    jQuery 17
    render ClassTypeId.ts:69
    render StartClassGroup.ts:32
    Bn TriggerOption.ts:119
    render CriteriaGroup.ts:191
    render GroupWrapper.ts:35
    initFirstGroupWrapper ComponentsList.ts:15
    render GroupWrapper.ts:77
    fi ComponentsList.ts:54
    render BgWrapper.ts:41
    render SparnaturalComponent.ts:40
    initSpecificationProvider SparnaturalComponent.ts:61
    build SparnaturalSpecificationFactory.ts:54
    buildStore BaseRDFReader.ts:80
    promise callback*buildStore BaseRDFReader.ts:75
    build SparnaturalSpecificationFactory.ts:46
    initSpecificationProvider SparnaturalComponent.ts:59
    render SparnaturalComponent.ts:97
    display SparnaturalElement.ts:48
    connectedCallback SparnaturalAttributes.ts:68
    <anonymous> SparnaturalElement.ts:18
    <anonymous> SparnaturalElement.ts:21
    <anonymous> SparnaturalElement.ts:21
[SHACLSpecificationProperty.ts:31:23](webpack://sparnatural/src/sparnatural/spec-providers/shacl/SHACLSpecificationProperty.ts)

and the query editor looks like image

with no relations to pick.

CFGrote commented 3 weeks ago

Looks like it did not like one or more of my other property shapes. It's kind of working now but the query contains a ?go_term a shapes:Go_term . clause. I could previously avoid this by setting nodeKind sh:Literal. But maybe it's again sth. else.

So in essence rebuilding solved the issue. Maybe worth mentioning somewhere prominent in the documentation that this is needed if working on the source code, not on downloaded artifacts. I started with the hello_sparnatural example and then gradually modified the config and html. So obviously (in hindsight), the js files never got updated.