Last active
August 29, 2015 14:14
-
-
Save elf-pavlik/406ffe0300e399f72c11 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@context": { | |
"@vocab": "http://schema.org/", | |
"mm": "http://ns.metamaps.cc/#", | |
"mmc": "http://metamaps.cc/metacodes/", | |
"permission": { "@type": "@id", "@id": "mm:permission"}, | |
"featured": "mm:featured", | |
"arranged": "mm:arranged" | |
}, | |
"@id": "http://metamaps.cc/maps/1207", | |
"@type": [ | |
"CreativeWork", | |
"mm:Metamap" | |
], | |
"name": "mm json-ld hackday", | |
"description": "example map for experimenting with RDF data model and JSON-LD serialization", | |
"image": "http://metamaps.cc/assets/missing-map.png", | |
"permission": "mm:commons", | |
"featured": false, | |
"arranged": false, | |
"dateCreated": "2015-01-24T20:07Z", | |
"dateModified": "2015-01-24T22:14Z", | |
"creator": { | |
"@id": "http://metamaps.cc/explore/mapper/1000497708", | |
"@type": "Person", | |
"name": "elf Pavlik", | |
"image": "http://metamaps.cc/assets/user.png", | |
"sameAs": [ | |
"http://metamaps.cc/topics/10126", | |
"https://wwelves.org/perpetual-tripper" | |
] | |
}, | |
"contributor": [ | |
{ | |
"@id": "http://metamaps.cc/explore/mapper/1000497524", | |
"@type": "Person", | |
"name": "poietic", | |
"image": "http://metamaps-live.s3.amazonaws.com/users/images/100/049/752/sixtyfour/IMS-NTB_2.png?1417299044", | |
"sameAs": [ | |
"http://metamaps.cc/topics/295", | |
"http://notthisbody.com" | |
] | |
}, | |
{ | |
"@id": "http://metamaps.cc/explore/mapper/555629996", | |
"@type": "Person", | |
"name": "Connor Turland", | |
"image": "http://metamaps.cc/assets/user.png", | |
"sameAs": [ | |
"http://metamaps.cc/topics/24", | |
"http://improv-ed.blogspot.com" | |
] | |
} | |
], | |
"@graph": [ | |
{ | |
"@id": "http://metamaps.cc/topics/24252", | |
"@type": [ | |
"Project", | |
"mmc:1047793150" | |
], | |
"name": "Metamaps Project", | |
"author": [ | |
"http://metamaps.cc/topics/295", | |
"http://metamaps.cc/topics/24" | |
], | |
"event": [ | |
"http://metamaps.cc/topics/24255" | |
], | |
"sameAs": [ | |
"https://github.com/metamaps/metamaps_gen002" | |
] | |
}, | |
{ | |
"@id": "http://metamaps.cc/topics/24255", | |
"@type": [ | |
"Event", | |
"mmc:1047793145" | |
], | |
"name": "metamaps hack day 1/24/15", | |
"attendee": [ | |
"http://metamaps.cc/topics/295", | |
"http://metamaps.cc/topics/24", | |
"http://metamaps.cc/topics/10126" | |
] | |
}, | |
{ | |
"@id": "http://metamaps.cc/topics/295", | |
"@type": [ | |
"Person", | |
"mmc:980190962" | |
], | |
"name": "poietic", | |
"sameAs": [ | |
"http://metamaps.cc/explore/mapper/1000497524", | |
"http://notthisbody.com" | |
] | |
}, | |
{ | |
"@id": "http://metamaps.cc/topics/24", | |
"@type": [ | |
"Person", | |
"mmc:980190962" | |
], | |
"name": "Connor Turland", | |
"sameAs": [ | |
"http://metamaps.cc/explore/mapper/555629996", | |
"http://improv-ed.blogspot.com" | |
] | |
}, | |
{ | |
"@id": "http://metamaps.cc/topics/10126", | |
"@type": [ | |
"Person", | |
"mmc:980190962" | |
], | |
"name": "elf Pavlik", | |
"sameAs": [ | |
"http://metamaps.cc/explore/mapper/1000497708", | |
"https://wwelves.org/perpetual-tripper" | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @elf-pavlik,
I happened to have installed metamaps locally to be able to map while I was offline and got a bit stuck when I realised I couldn't export back the map in the online version. That led me to stumble upon the import/export hackday hackpad which led me here. Given that I often have to convert from one json representation to another and that so far I was playing with the cool http://trentm.com/json/ I took the opportunity to search for a more robust solution and found jq which is much much better.
I thought that given that there isn't yet a JSON-LD import/export facility for metamaps, that it might be useful to contribute a jq command that helps transform the
contains.json
links to JSON-LD.Apart from the
sameAs
keys the and some minor differences which seem to come from the data itself, the diff below looks pretty good!This is the one liner that downloads map 1207 and outputs the transformed json-ld on stdout.
And this is it formatted. There's probably some better way to write the lookups for the
@graph
key. Also given that on metamaps, the link description is an open field, there's clearly some difficulties in mapping them to a vocabulary.Diff between
metamaps-example.jsonld
and result of the above jq command