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

Find Sub class of a Class #531

Closed manikyab closed 4 months ago

manikyab commented 9 months ago

Hi @tfrancart, I am new to sparnatural and I wanted to find out the list of objects in subclass of Class and no of objects having that same type For Example: a:Building rdfs:subClassOf a:Location

urn:123-456 rdf:type a:Building

Expected Output-> Building(1)

tfrancart commented 9 months ago

Hello

Welcomen first make sure you read http://docs.sparnatural.eu/hello-sparnatural/Hello-Sparnatural.html and http://docs.sparnatural.eu/how-to-configure/How-to-configure-Sparnatural.html

2 ways to do what you want:

  1. Add "Building" in your config, so that you will have both Location and Building to select from
  2. See https://github.com/sparna-git/Sparnatural/issues/494 . You can use a TreeProperty with the datasources datasources:tree_children_subClassOf and datasources:tree_root_domain_subClassOf

Also, we are thinking about improving the class selection to make it with 2-levels hierarchy : #351 (in 2024 probably)

tfrancart commented 4 months ago

Closing this, feel free to reopen if you have further questions