This file contains 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
import com.marklogic.xcc.*; | |
import com.marklogic.xcc.exceptions.RequestException; | |
import com.marklogic.xcc.exceptions.XccConfigException; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
import java.text.MessageFormat; | |
/** | |
* Example showing XCC with a URI which has not been encoded |
This file contains 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
import com.marklogic.xcc.*; | |
import com.marklogic.xcc.exceptions.RequestException; | |
import com.marklogic.xcc.exceptions.XccConfigException; | |
import java.io.UnsupportedEncodingException; | |
import java.net.URI; | |
import java.net.URISyntaxException; | |
import java.net.URLEncoder; | |
import java.text.MessageFormat; |
This file contains 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
xquery version "1.0-ml"; | |
declare namespace html = "http://www.w3.org/1999/xhtml"; | |
import schema "http://www.example.org/uri" at "/D/urisschema/uri.xsd"; | |
(: | |
this will validate against the specified schema, and will fail | |
if the schema does not exist (or if it is not valid according to | |
the schema) | |
:) |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/uri" | |
xmlns:tns="http://www.example.org/uri" elementFormDefault="qualified"> | |
<element name="simpleuri" type="anyURI" /> | |
</schema> |
This file contains 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
xquery version "1.0-ml"; | |
import module namespace sem = "http://marklogic.com/semantics" | |
at "/MarkLogic/semantics.xqy"; | |
sem:rdf-insert( | |
sem:triple( sem:iri("http://dbpedia.org/resource/Michael_Jackson"), | |
sem:iri("http://dbpedia.org/ontology/associatedBand"), | |
sem:iri("http://dbpedia.org/resource/The_Jackson_5") | |
) | |
) |
This file contains 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
xquery version "1.0-ml"; | |
import module namespace sem = "http://marklogic.com/semantics" | |
at "/MarkLogic/semantics.xqy"; | |
sem:query-results-serialize(sem:sparql(' | |
PREFIX db: <http://dbpedia.org/resource/> | |
PREFIX onto: <http://dbpedia.org/ontology/> | |
SELECT ?s | |
WHERE { ?s onto:associatedBand db:The_Jackson_5} |
This file contains 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
xquery version "1.0-ml"; | |
import module namespace sem = "http://marklogic.com/semantics" | |
at "/MarkLogic/semantics.xqy"; | |
sem:query-results-serialize(sem:sparql(' | |
PREFIX db: <http://dbpedia.org/resource/> | |
PREFIX onto: <http://dbpedia.org/ontology/> | |
SELECT ?s | |
WHERE { ?s onto:associatedBand db:The_Jackson_5} |
This file contains 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
<sparql xmlns="http://www.w3.org/2005/sparql-results#"> | |
<head> | |
<variable name="s"> | |
</variable> | |
</head> | |
<results> | |
<result> | |
<binding name="s"> | |
<uri>http://dbpedia.org/resource/Michael_Jackson | |
</uri> |
This file contains 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
<sparql xmlns="http://www.w3.org/2005/sparql-results#"> | |
<head> | |
<variable name="s"> | |
</variable> | |
</head> | |
<results> | |
<result> | |
<binding name="s"> | |
<uri>http://dbpedia.org/resource/Michael_Jackson</uri> | |
</binding> |
This file contains 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
var marklogic = require("marklogic"); | |
var conn = require("./env.js").connection; | |
//create database client | |
var db = marklogic.createDatabaseClient(conn); | |
var q = marklogic.queryBuilder; | |
//DatabaseClient.documents.query with qbe | |
db.documents.query( |
OlderNewer