Skip to content

feat: add getDataframeWithMetadata for RDFReader#63

Open
AuPath wants to merge 1 commit into
mainfrom
feat-62-rdfreader-sparql-metadata
Open

feat: add getDataframeWithMetadata for RDFReader#63
AuPath wants to merge 1 commit into
mainfrom
feat-62-rdfreader-sparql-metadata

Conversation

@AuPath

@AuPath AuPath commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Closes #62. Add support for returning SPARQL SELECT binding metadata according to the SPARQL JSON Results format. Each binding now includes its value, RDF term type (URI, blank node, or literal), datatype (e.g., xsd:string), and language tag when applicable.

This functionality is exposed through a new method rather than getDataframe(), preserving backward compatibility while making the feature opt-in.

An example usage in an MTL mapping can be seen here:

#set ( $rows = $reader.getDataframeWithMetadata("SELECT ?s ?name ?label WHERE { ?s a gtfs:Agency ; foaf:name ?name ; rdfs:label ?label . }") )
@prefix ex: <http://example.com/> .
#foreach($row in $rows)<$row.s.value> ex:name "$row.name.value" ; ex:nameType "$row.name.type" ; ex:nameDatatype "$row.name.datatype" ; ex:label "$row.label.value" ; ex:labelLang "$row.label.lang" .
#end

The map containing the value and metadata is accessed by using the binding specified in the sparql query. Then the 'value', 'type' and other metadata can be accessed using dot notation via standard keys which are fixed ('value', 'type', ...).

Closes #62. Add support for returning SPARQL SELECT binding metadata
according to the SPARQL JSON Results format. Each binding now includes
its value, RDF term type (URI, blank node, or literal), datatype (e.g.,
xsd:string), and language tag when applicable.

This functionality is exposed through a new method rather than
getDataframe(), preserving backward compatibility while making the
feature opt-in.
@AuPath AuPath requested a review from marioscrock June 29, 2026 09:06
@AuPath AuPath self-assigned this Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accessing RDF term type metadata in SPARQL SELECT in mapping

1 participant