Closed l00mi closed 3 years ago
Would it be possible to provide sample data (turtle), sample shapes (turtle) and the output that you would expect? That would help me a lot.
@l00mi Reminder ;)
The following example is not an attempt to find all edge cases but is a starting point.
It shows the input data (taken from https://www.w3.org/TR/vcard-rdf/) and an example of the Output. I do not know how the SHACL would need to look like to be able to get to this transformation, @bergos do you have any idea on that?
@base <http://example.com/me/> .
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
<corky> a vcard:Individual;
vcard:fn "Corky Crystal"; vcard:hasAddress <corky#address>; vcard:hasTelephone <corky#telephone>; vcard:nickname "Corks".
<corky#telephone> a vcard:Home, a vcard:Voice; vcard:hasValue "tel:+61755555555".
<corky#address> a vcard:Home; vcard:country-name "Australia"; vcard:locality "WonderCity"; vcard:postal-code "5555"; vcard:street-address "111 Lake Drive".
{
"address": {
"location_link": [{
"location": {
"city": {
"locality": "WonderCity",
"postal-code": "5555",
"country-name": "Australia"
},
"street-address": "111 Lake Drive"
}
}]
},
"aka": {
"fn": "Corky Crystal",
"nickname": "Corks"
}
}
Both structures visualised, left the graph, right the output.
For context, the goal of this transformation was to use this template:
<div>
<span class="glyphicon glyphicon-envelope" style="font-size:48px; float:left; margin: 0 15px 0 10px;"></span>
<div>
<b>{{address.aka.fn}}</b> [aka {{address.aka.nickname}}]<br>
{{address.location_link.0.location.street-address}}<br>
{{address.location_link.0.location.city.locality}} {{address.location_link.0.location.city.postal-code}}
<span style="text-transform:uppercase;">{{address.location_link.0.location.city.country-name}}</span>
</div>
</div>
I'll close this, as it does not really fit the scope of this library. By the way, I already have some version of this function in another project ;)
Loosly based on UC42.
Create a function which takes
.asJson(rootTerm, shaclTerm, shaclDataset)