SPARQL-Anything / sparql.anything

SPARQL Anything is a system for Semantic Web re-engineering that allows users to ... query anything with SPARQL.
https://sparql-anything.cc/
Apache License 2.0
218 stars 11 forks source link

Generate labels for the IRIs of classes and properties extracted from the source #462

Closed sgoetz-brox closed 3 months ago

sgoetz-brox commented 9 months ago

Examples from https://sparql-anything.readthedocs.io/en/stable/formats/Word_Processing_Document/

docs.table-headers=false:

  rdf:_7    [ rdf:_1  [ rdf:_1  "A" ;
                        rdf:_2  "B" ;
                        rdf:_3  "C"
                      ] ;
              rdf:_2  [ rdf:_1  "A1" ;
                        rdf:_2  "B1" ;
                        rdf:_3  "C1"
                      ] ;
              rdf:_3  [ rdf:_1  "A2" ;
                        rdf:_2  "B2" ;
                        rdf:_3  "C2"
                      ]
            ]

docs.table-headers=true:

  rdf:_7    [ rdf:_1  [ xyz:A   "A1" ;
                        xyz:B   "B1" ;
                        xyz:C   "C1"
                      ] ;
              rdf:_2  [ xyz:A   "A2" ;
                        xyz:B   "B2" ;
                        xyz:C   "C2"
                      ]
            ]

When set to true, the generated RDF doesn’t contain "A", "B", and "C" as literals anymore.

I think it would be useful if something like this would be generated:

xyz:A rdfs:label "A" .
xyz:B rdfs:label "B" .
xyz:C rdfs:label "C" .

(Of course one could convert the IRI to a string and extract the label from it, but this becomes ugly if percent-encoding is involved.)

Is this maybe possible already? If not, would this be something that could be added to SPARQL Anything, or would this be in conflict with its design goals?

luigi-asprino commented 9 months ago

Hi,

this is something that applies to every format (the label can be generated once an xyz predicate is created). An idea could be adding a new general option (e.g. generate-predicate-labels)

luigi-asprino commented 3 months ago

439b7fc introduces this feature