Closed rokj closed 4 years ago
@rokj I suspect the issue is in your context definition. The only term you define is "as". All the other terms in your document will be ignored at the expansion stage of normalisation. As a result, the output is empty. A good way to debug complex operations like normalisation is to apply expansion to your JSON-LD document first. Most problems are at that stage. And the quickest way to do it is to use JSON-LD playground.
I got it working with:
_data := map[string]interface{} {
"@context": "https://www.w3.org/ns/activitystreams.jsonld",
"id": "http://friendica2.local/activity/e6f33173-9381-86bb-c047-4f5c7be22380",
"type": "Follow",
"actor": "http://friendica2.local/profile/rjaklic5",
"object": "http://friendica.local/profile/rjaklic15",
"instrument": map[string]interface{}{
"type": "Service",
"name": "Friendica 'Red Hot Poker' 2020.03-1338",
"url": "http://friendica2.local",
},
"to": "http://friendica.local/profile/rjaklic15",
}
I try to normalize following structure:
but without success. All I get is an empty string. Any ideas why?
I am using following function to Normalize.