sparql.anything icon indicating copy to clipboard operation
sparql.anything copied to clipboard

rdfs:label for IRIs generated by docs.table-headers

Open sgoetz-brox opened this issue 1 year ago • 1 comments

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?

sgoetz-brox avatar Feb 19 '24 15:02 sgoetz-brox

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 avatar Feb 19 '24 15:02 luigi-asprino

439b7fc introduces this feature

luigi-asprino avatar Aug 06 '24 12:08 luigi-asprino