I hereby claim:
- I am grechaw on github.
- I am grechaw (https://keybase.io/grechaw) on keybase.
- I have a public key ASC7WhaH-M58jed-AFHw7uad4BeixNo3WAdW9M0-dwdkBQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| ### Keybase proof | |
| I hereby claim: | |
| * I am grechaw on github. | |
| * I am grechaw (https://keybase.io/grechaw) on keybase. | |
| * I have a public key ASAboIxZrwaJCW150VPgpDCTl9bpKRgWV2Ln-yzdmIqKGQo | |
| To claim this, I am signing this object: |
| (: turn a QA Harness test file into a QConsole Workspace :) | |
| declare namespace h = "http://marklogic.com/xdmp/harness"; | |
| let $QA_HOME := "/MarkLogic/git/qa-trunk" | |
| let $source := ($QA_HOME || "/scripts/tests/rest-client-api-documents-06.xml") | |
| =>xdmp:filesystem-file() | |
| =>xdmp:unquote() | |
| let $queries := |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <template xmlns="http://marklogic.com/xdmp/tde"> | |
| <description> | |
| A custom TDE for tagging instances of Runner as instance of RDFS class Runner. | |
| </description> | |
| <context>//es:instance//Runner</context> | |
| <path-namespaces> | |
| <path-namespace> | |
| <prefix>es</prefix> | |
| <namespace-uri>http://marklogic.com/entity-services</namespace-uri> |
| { | |
| "info": { | |
| "baseUri": "http://marklogic.com/offshore-leaks/", | |
| "description": "An attempt to model a real data set (single source) in entity services. The data froms from http://offshoreleaks.icij.org/pages/database.", | |
| "title": "OffshoreLeaks", | |
| "version": "0.0.1" | |
| }, | |
| "definitions": { | |
| "Address": { | |
| "primaryKey": "node_id", |
| public static EvalResultIterator eval(String functionCall) throws TestEvalException { | |
| String imports = | |
| "import module namespace sem = 'http://marklogic.com/semantics' at '/MarkLogic/semantics.xqy';\n"; | |
| ServerEvaluationCall call = | |
| client.newServerEval().xquery(entityServicesImport + functionCall); | |
| EvalResultIterator results = null; | |
| try { | |
| results = call.eval(); |
| { | |
| "info": { | |
| "title": "Person", | |
| "version": "0.0.2" | |
| }, | |
| "definitions": { | |
| "Person": { | |
| "properties": { | |
| "id": { | |
| "type": "string" |
| (: if for some reason you want to take MarkLogic XML triples and make JSON triples from them, here's how: :) | |
| let $docs := ("/triplestore/1e5ca14152cd5e08.xml","/triplestore/61ac1300bf2345c4.xml","/triplestore/6b24e3291b9d8fe0.xml","/triplestore/860af3160dfa6a14.xml") | |
| let $triples := for $d in $docs | |
| return doc($d)//sem:triple | |
| let $json-triples := | |
| for $t in $triples | |
| let $object := map:new(( | |
| map:entry("value" , $t/sem:object/text()), | |
| if ($t/sem:object/@datatype) then map:entry("datatype", $t/sem:object/@datatype) else (), |
| xquery version "1.0-ml"; | |
| for $d in cts:search(collection(), cts:directory-query("/questions/")) | |
| where $d/answers/accepted[.=true()] | |
| return xdmp:document-add-permissions( $d/base-uri() , xdmp:permission("samplestack-guest", "read")) |
| PREFIX pdb: <http://oreilly.com/legacy/pdb/> | |
| PREFIX product: <urn:x-domain:oreilly.com:product:> | |
| PREFIX dc: <http://purl.org/dc/terms/> | |
| PREFIX pt: <http://purl.oreilly.com/product-types/> | |
| PREFIX trons: <http://purl.oreilly.com/ns/trons/> | |
| PREFIX status: <http://purl.oreilly.com/statuses/> | |
| PREFIX frbr: <http://purl.org/vocab/frbr/core#> | |
| PREFIX mods: <http://www.loc.gov/mods/> | |
| PREFIX pubs: <http://purl.oreilly.com/publishers/> | |
| PREFIX om: <http://purl.oreilly.com/ns/meta/> |