Skip to content

Instantly share code, notes, and snippets.

View kurtcagle's full-sized avatar

Kurt Cagle kurtcagle

  • Semantical LLC
  • Bellevue, WA 98006
  • 11:20 (UTC -07:00)
View GitHub Profile
@kurtcagle
kurtcagle / MedicalPractitionerTypes.xml
Last active December 7, 2015 09:43
Medical Practitioner Types (sample for taxonomy source)
<?xml version="1.0" encoding="UTF-8"?>
<taxonomy xmlns="http://uhc.com/odm/c360/reference-data">
<scheme>Optum_Vocabularies</scheme>
<parent-taxonomy>Vocabularies_Demographics</parent-taxonomy>
<taxonomy-name>MedicalPractitionerTypes</taxonomy-name>
<taxonomy-label>Medical Practitioner Types</taxonomy-label>
<desc>A listing of the various medical practitioner types</desc>
<index-by>weight-alpha</index-by>
<items>
<item>
@kurtcagle
kurtcagle / ns.xqy
Last active December 21, 2015 01:49
Semantical ns: module, used for managing namespaces in both XQuery and semantic applications
module namespace ns = "http://semanticalllc.com/ns/namespace#";
import module namespace sem = "http://marklogic.com/semantics" at "/MarkLogic/semantics.xqy";
declare variable $ns:source-path := "/models/namespaces.ttl";
declare function ns:load($src as xs:string?) as item()*{
let $src := if ($src) then $src else $ns:source-path
let $triples := sem:rdf-parse(fn:unparsed-text($src),"turtle")
let $graph-ns := sem:iri("http://semanticalllc.com/ns/graph/namespace#")
return (
sem:graph-delete($graph-ns),
@kurtcagle
kurtcagle / namespace.ttl
Created December 20, 2015 08:35
A sample namespace file for use with the ns.xqy namespaces library.
@prefix ns: <http://semanticalllc.com/ns/namespace#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix xs: <http://www.w3.org/2001/XMLSchema>.
@prefix cts: <http://marklogic.com/cts>.
@prefix term: <http://semanticalllc.com/ns/canonical/term/>.
@prefix class: <http://semanticalllc.com/ns/canonical/class/>.
@prefix graph: <http://semanticalllc.com/ns/canonical/graph/>.
@prefix scheme: <http://semanticalllc.com/ns/canonical/scheme/>.
@prefix skos: <http://semanticalllc.com/ns/canonical/scheme/>.
@prefix review: <http://semantical.com/ns/reviews#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix company: <http://semantical.com/ns/company#> .
@prefix film: <http://semantical.com/ns/film#> .
@prefix class: <http://semantical.com/ns/class#> .
film:StarWars7
a film:Film ;
film:productionStudio company:TWDC ;
film:productionDate "2015-12-16" ;
<html>
<head>
<title>A Star Wars 7 Review</title>
</head>
<body prefix="review: http://semantical.com/ns/review#
author: http://semantical.com/ns/author#
film: http://semantical.com/ns/film#"
about="http://semantical.com/ns/review#StarWars7">
<h1 property="review:title">A Star Wars 7 Review</h1>
<div class="byline" property="review:author" resource="author:KurtCagle">by Kurt Cagle</div>
@kurtcagle
kurtcagle / starWarsReview2.ttl
Last active January 11, 2016 02:07
Short Revision for Star Wars Review
@prefix author: <http://semantical.com/ns/author#> .
@prefix film: <http://semantical.com/ns/film#> .
@prefix review: <http://semantical.com/ns/review#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
review:StarWars7 review:articleTopic film:StarWars7;
review:author author:KurtCagle;
review:pubdate "2016-01-10"^^xsd:date;
review:summary "This is a review of Star Wars: The Force Awakens."^^xsd:string;
review:title "A Star Wars 7 Review" .
<rdf:RDF
xmlns:film="http://semantical.com/ns/film#"
xmlns:company="http://semantical.com/ns/company#"
xmlns:class="http://semantical.com/ns/class#"
xmlns:director="http://semantical.com/ns/director#"
xmlns:reviews="http://semantical.com/ns/reviews#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
<Description about="review:StarWars7">
<review:author>Kurt Cagle</review:author>
@kurtcagle
kurtcagle / ArtOfNames1.ttl
Created February 14, 2016 03:30
From the Art of Names, Listing 1
<person>
<firstName> "Jane";
<lastName> "Doe";
.
Listing 1. A personal name.
@kurtcagle
kurtcagle / ArtOfNames2.ttl
Created February 14, 2016 03:34
The Art of Names, Listing 2
# Model
<person>
a <Class>.
<firstName>
a <Property>;
<domain> <person>;
<range> <string>.
<lastName>
@kurtcagle
kurtcagle / ArtOfNames3.ttl
Last active February 14, 2016 03:37
The Art of Names, Listing 3
#JSON Instance
{person: {
firstName:"Jane",
lastName:"Doe"
}
}
#XML Instance
<person>
<firstName>Jane</firstName>