Created
December 7, 2012 10:03
-
-
Save jprante/4232257 to your computer and use it in GitHub Desktop.
JSON-LD in Elasticsearch
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
curl -XDELETE 'localhost:9200/jsonld' | |
curl -XPOST 'localhost:9200/jsonld' | |
curl -XPUT 'localhost:9200/jsonld/doc/1' -d ' | |
{ | |
"@context": | |
{ | |
"dc": "http://purl.org/dc/elements/1.1/", | |
"ex": "http://example.org/vocab#" | |
}, | |
"@id": "http://example.org/library", | |
"@type": "ex:Library", | |
"ex:contains": | |
{ | |
"@id": "http://example.org/library/the-republic", | |
"@type": "ex:Book", | |
"dc:creator": "Plato", | |
"dc:title": "The Republic", | |
"ex:contains": | |
{ | |
"@id": "http://example.org/library/the-republic#introduction", | |
"@type": "ex:Chapter", | |
"dc:description": "An introductory chapter on The Republic.", | |
"dc:title": "The Introduction" | |
} | |
} | |
} | |
' | |
curl -XGET 'localhost:9200/_refresh' | |
curl -XPOST 'localhost:9200/jsonld/_search?pretty' -d ' | |
{ | |
"query": { | |
"match" : { | |
"dc:creator" : "Plato" | |
} | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment