Description
I have a few cases in recent projects where clients would like to flatten RDF, for example to generate a CSV, or render a table in HTML without complex nesting or needing to somehow indicate inverse paths visually etc.
I'm already expressing the property paths that are in scope to describe a resource using sh:union.
I would like a way to say there is an alias for the path, something like sh:pathAlias, and I would like the range to be an IRI so I can reference the shape / full property path that the alias is for.
Looking at the spec I believe sh:name can have an IRI in its range, though I don't my use case aligns with the intended use of the property.
sh:union (
[ sh:path ( sosa:isSampleOf [ sh:inversePath dcterms:hasPart ] schema:identifier ) ]
... other property paths
sh:union (
[
sh:path ( sosa:isSampleOf [ sh:inversePath dcterms:hasPart ] schema:identifier ) ;
sh:pathAlias <https://parent-identifier>
]
... other property paths
In my specific use case I'm translating this to SPARQL, so in the construct triples I would use the alias, and in the where clause use the full property paths.
I believe this is possible with rules and the proposal around "calculated" fields may suit too, ideally something more succinct as above would be good - I often have 10+ property paths for a particular "profile" of a resource.