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

NotInstantiatedClass with defaultLabelProperty rdfs:label is not added to the sparql generation when clicking on the class visibility icon #550

Open PyHahiro opened 5 months ago

PyHahiro commented 5 months ago

I have the following need :

If an ontology is starting to be very large, there may be many SparnaturalClass appearing in the initial list A solution to only display classes we want is to use : http://data.sparna.fr/ontologies/sparnatural-config-core#NotInstantiatedClass
But the issue of this solution comes from this description: a Not-Instantiated-Class must not yield an rdf:type criteria in the SPARQL query

What also happens is that when we click on the visibility icon (eye icon) of a NoInstantiatedClass, it adds ?class1 ?class1_label to the select statement of the query, but does not add the :
?class1 rdfs:label ?class1_label triple . to the query. It is important to note that said ?class1 is declared to have http://data.sparna.fr/ontologies/sparnatural-config-core#NotInstantiatedClass rdfs:label ;

tfrancart commented 5 months ago

Thanks. I think what you need is #332. This is not implemented yet. The "NotInstantiatedClass" is something slightly different, and should not be used for this.

Regarding your comment:

What also happens is that when we click on the visibility icon (eye icon) of a NoInstantiatedClass, it adds ?class1 ?class1_label > to the select statement of the query, but does not add the : ?class1 rdfs:label ?class1_label triple . to the query."

-> Which version of Sparnatural are you using ? -> could you share an example config file to reproduce this ?

PyHahiro commented 5 months ago

I am using sparnatural 8.4.0 I have the following model :

Boulangerie

Four

fo:Four rdfs:subClassOf sparna:NotInstantiatedClass ;
sparna:defaultLabelProperty rdfs:label ;
sparna:faIcon "fa-solid fa-fire-burner" ;
sparna:sparqlString "<http://anabasis-assets.com/ontologies/boulangerie/Four#Four>" ;
rdfs:label "Un four"@en ,
"Un four"@fr .

Boulangerie

bo:Boulangerie rdfs:subClassOf sparna:SparnaturalClass ;
        sparna:defaultLabelProperty rdfs:label ;
        sparna:tooltip "Une boulangerie"@fr ;
        sparna:faIcon "fa fa-store" ;
        rdfs:label "Une boulangerie"@en ,
                "Une boulangerie"@fr .

CuitAvec

# cuitAvec: Four
bo:cuitAvec rdfs:subPropertyOf sparna:AutocompleteProperty ;
rdfs:domain bo:Boulangerie ;
rdfs:range fo:Four ;
sparna:enableOptional "false"^^xsd:boolean ;
sparna:enableNegation "false"^^xsd:boolean ;
ds:datasource ds:search_rdfslabel_contains ;
rdfs:label "cuit avec"@fr ,
"cooks with"@en .

Actual :

Expected :

I will rename the issue accordingly

tfrancart commented 4 months ago

@PyHahiro Could you provide your complete config file ? thanks