mdld-parse 0.9.5 → 0.9.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -51
- package/dist/README.md +56 -51
- package/dist/docs/API.md +41 -5
- package/dist/docs/Parser.md +17 -7
- package/dist/docs/primary-subject.md +99 -23
- package/dist/examples/demo/journal.md +27 -86
- package/dist/examples/demo/project.md +50 -64
- package/dist/examples/demo/recipe.md +24 -69
- package/dist/examples/demo/research.md +37 -79
- package/dist/examples/demo/space-mission.md +32 -103
- package/dist/index.html +192 -422
- package/dist/index.js +35 -29
- package/package.json +1 -1
- package/dist/docs/Nostr.md +0 -544
package/dist/index.html
CHANGED
|
@@ -30,25 +30,25 @@
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<script type="module" crossorigin>var e=Object.defineProperty,t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var r={"@vocab":`http://www.w3.org/2000/01/rdf-schema#`,rdf:`http://www.w3.org/1999/02/22-rdf-syntax-ns#`,rdfs:`http://www.w3.org/2000/01/rdf-schema#`,xsd:`http://www.w3.org/2001/XMLSchema#`,sh:`http://www.w3.org/ns/shacl#`,prov:`http://www.w3.org/ns/prov#`},i=/^(https?|ftp|mailto|tag|nih|urn|uuid|did|web|ipfs|ipns|data|file|urn:uuid):/,a=/^(https?|ftp|mailto|tag|nih|urn|uuid|did|web|ipfs|ipns|data|file):/,o=class{constructor(e){this.id=e}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value}},s=class extends o{constructor(e){super(e),this.termType=`NamedNode`,this.value=e}},c=class extends o{constructor(e){super(e),this.termType=`Literal`,this.value=``,this.language=``,this.datatype=null;let t=e.match(/^"([^"\\]*(?:\\.[^"\\]*)*)"(\^\^([^"]+))?(@([^-]+)(--(.+))?)?$/);t?(this.value=t[1].replace(/\\"/g,`"`).replace(/\\\\/g,`\\`),t[5]?(this.language=t[5],this.datatype=new s(`http://www.w3.org/1999/02/22-rdf-syntax-ns#langString`)):t[3]?this.datatype=new s(t[3]):this.datatype=new s(`http://www.w3.org/2001/XMLSchema#string`)):(this.value=e.replace(/^"|"$/g,``),this.datatype=new s(`http://www.w3.org/2001/XMLSchema#string`))}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype?.value===e.datatype?.value}},l=class extends o{constructor(e){super(e||`b${Math.random().toString(36).slice(2,11)}`),this.termType=`BlankNode`,this.value=this.id}},u=class extends o{constructor(e){super(e),this.termType=`Variable`,this.value=e}},d=new class extends o{constructor(){super(``),this.termType=`DefaultGraph`,this.value=``}equals(e){return!!e&&this.termType===e.termType}},f=class extends o{constructor(e,t,n,r=d){super(`${e.id}|${t.id}|${n.id}|${r.id}`),this.termType=`Quad`,this.subject=e,this.predicate=t,this.object=n,this.graph=r}equals(e){return!!e&&this.termType===e.termType&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}toJSON(){return{termType:this.termType,subject:this.subject.toJSON?this.subject.toJSON():{termType:this.subject.termType,value:this.subject.value},predicate:this.predicate.toJSON?this.predicate.toJSON():{termType:this.predicate.termType,value:this.predicate.value},object:this.object.toJSON?this.object.toJSON():{termType:this.object.termType,value:this.object.value},graph:this.graph.toJSON?this.graph.toJSON():{termType:this.graph.termType,value:this.graph.value}}}},p={boolean:`http://www.w3.org/2001/XMLSchema#boolean`,integer:`http://www.w3.org/2001/XMLSchema#integer`,double:`http://www.w3.org/2001/XMLSchema#double`,string:`http://www.w3.org/2001/XMLSchema#string`},m={namedNode:e=>new s(e),blankNode:e=>new l(e),literal:(e,t)=>{let n=String(e).replace(/"/g,`\\"`);if(typeof t==`string`)return new c(`"${n}"@${t.toLowerCase()}`);if(t!==void 0&&!(`termType`in t)){let e=t.direction?`--${t.direction.toLowerCase()}`:``;return new c(`"${n}"@${t.language.toLowerCase()}${e}`)}let r=t?t.value:``;return r===``&&(typeof e==`boolean`?r=p.boolean:typeof e==`number`&&(Number.isFinite(e)?r=Number.isInteger(e)?p.integer:p.double:(r=p.double,Number.isNaN(e)||(e=e>0?`INF`:`-INF`)))),r===``||r===p.string?new c(`"${n}"`):new c(`"${n}"^^${r}`)},variable:e=>new u(e),defaultGraph:()=>d,quad:(e,t,n,r)=>new f(e,t,n,r),triple:(e,t,n,r)=>new f(e,t,n,r),fromTerm:e=>{if(e instanceof o)return e;switch(e.termType){case`NamedNode`:return new s(e.value);case`BlankNode`:return new l(e.value);case`Variable`:return new u(e.value);case`DefaultGraph`:return d;case`Literal`:let t=String(e.value).replace(/"/g,`\\"`);return e.language?new c(`"${t}"@${e.language}`):e.datatype?new c(`"${t}"^^${e.datatype.value||e.datatype}`):new c(`"${t}"`);case`Quad`:return m.fromQuad(e);default:throw Error(`Unexpected termType: ${e.termType}`)}},fromQuad:e=>{if(e instanceof f)return e;if(e.termType!==`Quad`){if(e.subject&&e.predicate&&e.object)return new f(m.fromTerm(e.subject),m.fromTerm(e.predicate),m.fromTerm(e.object),m.fromTerm(e.graph||m.defaultGraph()));throw Error(`Unexpected termType: ${e.termType}`)}return new f(m.fromTerm(e.subject),m.fromTerm(e.predicate),m.fromTerm(e.object),m.fromTerm(e.graph))}};function h(e,t){if(!e||!t||!t.quadIndex)return null;let n=C(e);return n&&t.quadIndex.get(n)||null}function g(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n);return Math.abs(t).toString(16).slice(0,12)}var _=new Map;function v(e,t){if(e==null)return null;let n=`${e}|${t[`@vocab`]||``}|${Object.keys(t).filter(e=>e!==`@vocab`).sort().map(e=>`${e}:${t[e]}`).join(`,`)}`;if(_.has(n))return _.get(n);let r=(typeof e==`string`?e:typeof e==`object`&&typeof e.value==`string`?e.value:String(e)).trim(),a;if(r.match(i))a=r;else if(r.includes(`:`)){let[e,n]=r.split(`:`,2);e&&!t[e]&&e!==`@vocab`&&console.warn(`Undefined prefix "${e}" in IRI "${r}" - treating as literal`),a=t[e]?t[e]+n:r}else a=(t[`@vocab`]||``)+r;return _.set(n,a),a}function y(e,t){if(!e||!a.test(e))return e;if(t[`@vocab`]&&e.startsWith(t[`@vocab`]))return e.substring(t[`@vocab`].length);for(let[n,r]of Object.entries(t))if(n!==`@vocab`&&e.startsWith(r)&&Object.entries(t).filter(([t,n])=>t!==`@vocab`&&e.startsWith(n)).every(([e,t])=>r.length>=t.length||e===n&&t.length===r.length))return n+`:`+e.substring(r.length);return e}var b={"=#":{kind:`fragment`,extract:e=>e.substring(2).replace(`}`,``)},"+#":{kind:`softFragment`,extract:e=>e.substring(2).replace(`}`,``)},"+":{kind:`object`,extract:e=>e.substring(1)},"^^":{kind:`datatype`,extract:e=>e.substring(2)},"@":{kind:`language`,extract:e=>e.substring(1)},".":{kind:`type`,extract:e=>e.substring(1)},"!":{kind:`property`,form:`!`,extract:e=>e.substring(1)},"?":{kind:`property`,form:`?`,extract:e=>e.substring(1)}};function x(e){try{let t=String(e||``).trim().replace(/^\{|\}$/g,``).trim();if(!t)return{subject:null,object:null,types:[],predicates:[],datatype:null,language:null,entries:[]};let n={subject:null,object:null,types:[],predicates:[],datatype:null,language:null,entries:[]},r=/\S+/g,i;for(;(i=r.exec(t))!==null;){let e=i[0],t=1+i.index,r=t+e.length,a=n.entries.length,o=!1;if(e.startsWith(`-`)&&e.length>1&&(o=!0,e=e.slice(1)),e===`=`){o&&console.warn(`-= is not valid, subject declarations have no polarity`),n.subject=`RESET`,n.entries.push({kind:`subjectReset`,relRange:{start:t,end:r},raw:e});continue}if(e.startsWith(`=`)&&!e.startsWith(`=#`)){o&&console.warn(`-= is not valid, subject declarations have no polarity`);let i=e.substring(1);n.subject=i,n.entries.push({kind:`subject`,iri:i,relRange:{start:t,end:r},raw:e});continue}let s=!1;for(let[c,l]of Object.entries(b))if(e.startsWith(c)){let c={kind:l.kind,relRange:{start:t,end:r},raw:i[0]},u=l.extract(e);l.kind===`fragment`?(n.subject=`=#${u}`,c.fragment=u):l.kind===`softFragment`?(n.object=`#${u}`,c.fragment=u):l.kind===`object`?(o&&=(console.warn(`-+ is not valid, object declarations have no polarity`),!1),n.object=u,c.iri=u):l.kind===`datatype`?(o&&=(console.warn(`-^^ is not valid, datatype modifiers have no polarity`),!1),n.language||(n.datatype=u),c.datatype=u):l.kind===`language`?(o&&=(console.warn(`-@ is not valid, language modifiers have no polarity`),!1),n.language=u,n.datatype=null,c.language=u):l.kind===`type`?(n.types.push({iri:u,entryIndex:a,remove:o}),c.iri=u,c.remove=o):l.kind===`property`&&(n.predicates.push({iri:u,form:l.form,entryIndex:a,remove:o}),c.iri=u,c.form=l.form,c.remove=o),n.entries.push(c),s=!0;break}s||(n.predicates.push({iri:e,form:``,entryIndex:a,remove:o}),n.entries.push({kind:`property`,iri:e,form:``,relRange:{start:t,end:r},raw:i[0],remove:o}))}return n}catch(t){return console.error(`Error parsing semantic block ${e}:`,t),{subject:null,object:null,types:[],predicates:[],datatype:null,language:null,entries:[]}}}function S(e,t,n){let r=n.termType===`Literal`?JSON.stringify({t:`Literal`,v:n.value,lang:n.language||``,dt:n.datatype?.value||``}):JSON.stringify({t:n.termType,v:n.value});return JSON.stringify([e.value,t.value,r])}function C(e){return e?S(e.subject,e.predicate,e.object):null}function w(e,t,n,r,i){return t?i.literal(e,i.namedNode(v(t,r))):n?i.literal(e,n):i.literal(e)}function T(e){if(e.length<3)return null;let t=e[0];if(t!=="`"&&t!==`~`)return null;let n=1;for(;n<e.length&&e[n]===t;)n++;if(n<3)return null;let r=e.slice(n).trimStart(),i=r.match(/^([^\s{]+)/),a=i?i[1]:``,o=r.match(/\{([^}]+)\}/),s=o?o[1]:null;return{fenceChar:t,fenceLength:n,lang:a,attrs:s,infoString:r}}function E(e){if(e[0]!==`[`)return null;let t=e.indexOf(`]`,1);if(t===-1)return null;let n=e.slice(1,t).trim();if(!n)return null;let r=t+1;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r>=e.length||e[r]!==`<`)return null;let i=e.indexOf(`>`,r+1);if(i===-1)return null;let a=e.slice(r+1,i).trim();return a?{prefix:n,iri:a}:null}function D(e){if(e[0]!==`#`)return null;let t=1;for(;t<e.length&&t<6&&e[t]===`#`;)t++;if(t>=e.length||e[t]!==` `&&e[t]!==` `)return null;let n=t;for(;n<e.length&&(e[n]===` `||e[n]===` `);)n++;let r=e.slice(n),i=r.match(/\s*\{([^}]+)\}\s*$/),a=r,o=null;return i&&(o=i[1],a=r.slice(0,-i[0].length).trim()),{depth:t,content:a,attrs:o}}function ee(e){let t=0;for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;let n=t;if(t>=e.length)return null;let r=e[t],i,a=t+1;if(r===`-`||r===`*`||r===`+`)i=r;else if(r>=`0`&&r<=`9`){let n=t+1;for(;n<e.length&&e[n]>=`0`&&e[n]<=`9`;)n++;if(n>=e.length||e[n]!==`.`)return null;i=e.slice(t,n+1),a=n+1}else return null;if(a>=e.length||e[a]!==` `&&e[a]!==` `)return null;for(;a<e.length&&(e[a]===` `||e[a]===` `);)a++;let o=e.slice(a),s=null,c=o.match(/\s*\{([^}]+)\}\s*$/);return c&&(s=c[1],o=o.slice(0,-c[0].length).trim()),{indent:n,marker:i,content:o,attrs:s}}function O(e){if(e[0]!==`>`||e.length>1&&e[1]!==` `&&e[1]!==` `)return null;let t=1;for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;let n=e.slice(t),r=null,i=n.match(/\s*\{([^}]+)\}\s*$/);return i&&(r=i[1],n=n.slice(0,-i[0].length).trim()),{content:n,attrs:r}}function k(e){let t=0;for(;t<e.length&&(e[t]===` `||e[t]===` `);)t++;if(t>=e.length||e[t]!==`{`||(t++,t>=e.length||e[t]!==`=`))return null;t++;let n=t,r=1;for(;t<e.length&&r>0;)e[t]===`{`&&r++,e[t]===`}`&&r--,r>0&&t++;if(r>0)return null;let i=e.slice(n,t).trim();for(t++;t<e.length&&(e[t]===` `||e[t]===` `);)t++;return t<e.length?null:{content:i}}function A(e,t,n=`[`,r=`]`){let i=1,a=t+1;for(;a<e.length&&i>0;)e[a]===n&&i++,e[a]===r&&i--,i>0&&a++;return i===0?a:null}function j(e,t){let n=t;for(;n<e.length&&(e[n]===` `||e[n]===` `);)n++;if(n>=e.length||e[n]!==`{`)return null;let r=e.indexOf(`}`,n+1);return r===-1?null:{attrs:e.slice(n+1,r),endPos:r+1}}function M(e,t){if(e[t]!==`<`)return null;let n=e.indexOf(`>`,t+1);if(n===-1)return null;let r=e.slice(t+1,n).trim();return r.match(/^[a-zA-Z][a-zA-Z0-9+\-.]*:/)?{url:r,endPos:n+1}:null}function N(e,t){let n=e[t];if(n!==`*`&&n!==`_`)return null;let r=1;for(;t+r<e.length&&e[t+r]===n;)r++;if(r>2)return null;let i=r===1?`emphasis`:`strong`,a=n.repeat(r),o=t+r,s=o;for(;s<e.length;){if(e.slice(s,s+r)===a){if(s+r<e.length&&e[s+r]===n){s++;continue}let t=e.slice(o,s),a=s+r,c=j(e,a),l=c?c.endPos:a;return{type:i,content:t,attrs:c?.attrs||null,endPos:l,contentEnd:a}}s++}return null}function P(e,t){if(e[t]!=="`")return null;let n=1;for(;t+n<e.length&&e[t+n]==="`";)n++;if(n>2)return null;let r="`".repeat(n),i=t+n,a=i;for(;a<e.length;){if(e.slice(a,a+n)===r){let t=e.slice(i,a),r=a+n,o=j(e,r),s=o?o.endPos:r;return{type:`code`,content:t,attrs:o?.attrs||null,endPos:s,contentEnd:r}}a++}return null}function te(e,t){if(e[t]!==`[`)return null;let n=A(e,t,`[`,`]`);if(!n)return null;let r=e.slice(t+1,n),i=n+1,a=null;if(i<e.length&&e[i]===`(`){let t=e.indexOf(`)`,i+1);t!==-1&&(a=e.slice(i+1,t),i=t+1)}else if(i<e.length&&e[i]===`<`){let t=e.indexOf(`>`,i+1);if(t!==-1){let n=e.slice(i+1,t).trim();n.match(/^[a-zA-Z][a-zA-Z0-9+\-.]*:/)&&(a=n,i=t+1)}}let o=j(e,i),s=o?o.endPos:i;return{type:a?`link`:`span`,text:r,url:a,attrs:o?.attrs||null,endPos:s,bracketEnd:n+1}}function F(e,t=0){let n=[],r=e.length,i=0;for(;i<r;){let r=e[i],a=null;switch(r){case`<`:if(a=M(e,i),a){let t=j(e,a.endPos);t&&(a.attrs=t.attrs,a.endPos=t.endPos),a.type=`link`,a.text=a.url}break;case`[`:a=te(e,i);break;case`*`:case`_`:a=N(e,i);break;case"`":a=P(e,i);break}if(!a){i++;continue}let o=a.url,s=a.type,c=a.attrs;if(o?.startsWith(`=`)||s===`link`&&!c&&!o){i=a.endPos;continue}let l=t+i,u=t+a.endPos,d=t+(a.contentEnd||a.bracketEnd||a.endPos),f={type:s,text:a.content===void 0?a.text===void 0?o:a.text:a.content,range:[l,u],valueRange:[l+ +(s===`url`),d-+(s===`url`)],attrs:c,url:o,pos:a.endPos};c&&(f.attrsRange=[d,u]),n.push(f),i=a.endPos}return n}var I=new Map;function ne(e){return I.has(e)||I.set(e,RegExp(`^(${e}{3,})`)),I.get(e)}function re(e,t,n,r,i){let a=r+(r<e.length&&e[r]===` `?1:e.slice(r).match(/^\s+/)?.[0]?.length||0);return{valueRange:[n+a,n+a+i],attrsRange:L(e,t,n)}}function L(e,t,n){if(!t)return null;let r=e.lastIndexOf(t);return r>=0?[n+r,n+r+t.length]:null}function R(e,t,n,r=null,i=null,a=null,o={}){let s={type:e,range:t,text:n,attrs:r,attrsRange:i,valueRange:a,...o};return Object.defineProperty(s,`_carriers`,{enumerable:!1,writable:!0,value:null}),s}function ie(e,t,n,r,i){let a=i[4]||null,o=re(t,a,n,i[1].length+(i[2]?i[2].length:0),i[3].length);return R(e,[n,r-1],i[3].trim(),a,o.attrsRange,o.valueRange,{indent:i[1].length})}var z={},ae=Object.freeze({predicates:[],types:[],subject:null});function oe(e){if(!e)return ae;let t=z[e];return t||(t=Object.freeze(x(e)),z[e]=t),t}function se(e){if(!e.text)return``;let t=e.text;e.attrsRange&&(t=t.substring(0,e.attrsRange[0]-(e.range?.[0]||0))+t.substring(e.attrsRange[1]-(e.range?.[0]||0)));let n=(e._carriers||[]).filter(e=>e.attrsRange).map(t=>t.attrsRange.map(t=>t-(e.range?.[0]||0))).filter(([e,n])=>e>=0&&n<=t.length).sort((e,t)=>t[0]-e[0]);for(let[e,r]of n)t=t.substring(0,e)+t.substring(r);switch(e.type){case`heading`:return t.replace(/^#+\s*/,``).trim();case`list`:return t.replace(/^[-*+]\s*/,``).trim();case`blockquote`:return t.replace(/^>\s*/,``).trim();default:return t.trim()}}function ce(e,t,n,r=null){return{blockId:e.id,range:e.range,carrierType:e.carrierType,subject:t.value,predicate:n.value,context:e.context,polarity:r?.remove?`-`:`+`,value:e.text||``}}function le(e,t,n){if(!t)return null;let r=t.value,i=r.indexOf(`#`),a=i>-1?r.slice(0,i):r;return n.namedNode(a+`#`+e)}function ue(e,t){return e.subject?e.subject===`RESET`?(t.currentSubject=null,null):e.subject.startsWith(`=#`)?le(e.subject.substring(2),t.currentSubject,t.df):t.df.namedNode(v(e.subject,t.ctx)):null}function de(e,t){return e.object?e.object.startsWith(`#`)?le(e.object.substring(1),t.currentSubject,t.df):t.df.namedNode(v(e.object,t.ctx)):null}function fe(e){return e?.termType===`Literal`}function pe(e){return e?.termType===`NamedNode`}function me(e){return e?.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`}function he(e,t){if(!e)return null;let n=y(e,t);return n.includes(`:`)?n.split(`:`)[0]:null}function ge(e,t){let n=new Set;for(let r of e.values())for(let e of r){let r=he(e.subject.value,t);r&&n.add(r);let i=he(e.predicate.value,t);if(i&&n.add(i),pe(e.object)){let r=he(e.object.value,t);r&&n.add(r)}if(e.object.datatype&&e.object.datatype.value){let r=he(e.object.datatype.value,t);r&&n.add(r)}}return n}function _e(e,t,n,r,i=[]){let a=r(e,t);t.currentBlock=a,t.blockStack.push(a.id),i.forEach(n=>n(e,t)),n(e,t,e.type),t.blockStack.pop(),t.currentBlock=t.blockStack.length>0?t.origin.blocks.get(t.blockStack[t.blockStack.length-1]):null}function B(e){return e.sort((e,t)=>e.predicate.value.localeCompare(t.predicate.value))}var ve=(e,t)=>`[${e}] <${t}>\n`;function V(e,t){let n=y(e.predicate.value,t);e.object.language?n+=` @${e.object.language}`:e.object.datatype.value!==`http://www.w3.org/2001/XMLSchema#string`&&(n+=` ^^${y(e.object.datatype.value,t)}`);let r=e.object.value||e.object,i=typeof r==`string`?r:String(r),a=e.object.datatype?.value||``;return i.includes(`
|
|
33
|
-
`)?`~~~ {${n}}\n${i}\n~~~\n\n`:a.includes(`integer`)||a.includes(`decimal`)||a.includes(`double`)||a.includes(`float`)?`\`${i}\` {${n}}\n`:a.includes(`date`)||a.includes(`time`)?`*${i}* {${n}}\n`:a.includes(`boolean`)?`**${i}** {${n}}\n`:`[${i}] {${n}}\n`}var ye=(e,t,n=null)=>{let r=y(e.object.value,t),i=y(e.predicate.value,t);return`[${n&&n.has(e.object.value)?n.get(e.object.value):r}] {+${r} ?${i}}\n`};function be(e){let t=[],n=[],r=[];for(let i of e)me(i.predicate)?t.push(i):fe(i.object)?n.push(i):pe(i.object)&&r.push(i);return{types:t,literals:n,objects:r}}function H(e,t={}){let n=typeof e==`object`&&!!e&&`text`in e,i=n?e.text:e,a=n?{context:e.context,dataFactory:e.dataFactory,graph:e.graph}:t,o={ctx:{...r,...a.context||{}},df:a.dataFactory||m,graph:a.graph?m.namedNode(a.graph):m.defaultGraph(),quads:[],quadBuffer:new Map,removeSet:new Set,origin:{quadIndex:new Map,blocks:new Map,documentStructure:[]},currentSubject:null,primarySubject:null,primaryType:null,primaryLabel:null,tokens:null,currentTokenIndex:-1,statements:[],statementCandidates:new Map,currentBlock:null,blockStack:[]},s=Se(i);o.tokens=s.tokens;for(let e=0;e<o.tokens.length;e++){let t=o.tokens[e];if(o.currentTokenIndex=e,t.type===`prefix`){let e=t.iri;if(t.iri.includes(`:`)){let n=t.iri.indexOf(`:`),r=t.iri.substring(0,n),i=t.iri.substring(n+1);o.ctx[r]&&r!==`@vocab`&&(e=o.ctx[r]+i)}o.ctx[t.prefix]=e;continue}Le[t.type]?.(t,o)}let c=new Set;for(let e of o.quads)c.add(S(e.subject,e.predicate,e.object));let l=[];for(let e of o.removeSet){let t=S(e.subject,e.predicate,e.object);c.has(t)||l.push(e)}return{quads:o.quads,remove:l,statements:o.statements,origin:o.origin,context:o.ctx,primarySubject:o.primarySubject,
|
|
33
|
+
`)?`~~~ {${n}}\n${i}\n~~~\n\n`:a.includes(`integer`)||a.includes(`decimal`)||a.includes(`double`)||a.includes(`float`)?`\`${i}\` {${n}}\n`:a.includes(`date`)||a.includes(`time`)?`*${i}* {${n}}\n`:a.includes(`boolean`)?`**${i}** {${n}}\n`:`[${i}] {${n}}\n`}var ye=(e,t,n=null)=>{let r=y(e.object.value,t),i=y(e.predicate.value,t);return`[${n&&n.has(e.object.value)?n.get(e.object.value):r}] {+${r} ?${i}}\n`};function be(e){let t=[],n=[],r=[];for(let i of e)me(i.predicate)?t.push(i):fe(i.object)?n.push(i):pe(i.object)&&r.push(i);return{types:t,literals:n,objects:r}}function H(e,t={}){let n=typeof e==`object`&&!!e&&`text`in e,i=n?e.text:e,a=n?{context:e.context,dataFactory:e.dataFactory,graph:e.graph}:t,o={ctx:{...r,...a.context||{}},df:a.dataFactory||m,graph:a.graph?m.namedNode(a.graph):m.defaultGraph(),quads:[],quadBuffer:new Map,removeSet:new Set,origin:{quadIndex:new Map,blocks:new Map,documentStructure:[]},currentSubject:null,primarySubject:null,primaryType:null,primaryLabel:null,tokens:null,currentTokenIndex:-1,statements:[],statementCandidates:new Map,currentBlock:null,blockStack:[]},s=Se(i);o.tokens=s.tokens;for(let e=0;e<o.tokens.length;e++){let t=o.tokens[e];if(o.currentTokenIndex=e,t.type===`prefix`){let e=t.iri;if(t.iri.includes(`:`)){let n=t.iri.indexOf(`:`),r=t.iri.substring(0,n),i=t.iri.substring(n+1);o.ctx[r]&&r!==`@vocab`&&(e=o.ctx[r]+i)}o.ctx[t.prefix]=e;continue}Le[t.type]?.(t,o)}let c=new Set;for(let e of o.quads)c.add(S(e.subject,e.predicate,e.object));let l=[];for(let e of o.removeSet){let t=S(e.subject,e.predicate,e.object);c.has(t)||l.push(e)}let u={subject:o.primarySubject,type:o.primaryType,label:o.primaryLabel,comment:o.primaryComment};return{quads:o.quads,remove:l,statements:o.statements,origin:o.origin,context:o.ctx,primarySubject:o.primarySubject,primary:u,md:s.md}}function xe(e){return e.type===`code`?[]:e._carriers||=Ce(e.text,e.range[0])}function Se(e){let t=[],n=[],r=e.split(`
|
|
34
34
|
`),i=0,a=null,o=[{type:`fence`,test:e=>T(e.trim()),process:s},{type:`content`,test:()=>a,process:e=>a.content.push(e)},{type:`prefix`,test:e=>E(e),process:c},{type:`standalone`,test:e=>k(e),process:p},{type:`heading`,test:e=>D(e),process:l},{type:`list`,test:e=>ee(e),process:u},{type:`blockquote`,test:e=>O(e),process:d},{type:`para`,test:e=>e.trim(),process:f}];function s(e,r,i){let o=e.trim();if(a){let i=a.fence[0],s=i.repeat(a.fence.length),c=o.match(ne(i));if(c&&c[1]===s){let i=a.valueRangeStart,o=Math.max(i,r-1);t.push({type:`code`,range:[a.start,r],text:a.content.join(`
|
|
35
35
|
`),lang:a.lang,attrs:a.attrs,attrsRange:a.attrsRange,valueRange:[i,o]});for(let e of a.content)n.push(e);a=null;let s=e.replace(/\r?\n.*$/,``);n.push(s)}}else{let t=T(o);if(!t)return!1;let i=t.attrs,s=i?e.indexOf(i):-1,c=r+e.length+1;a={fence:t.fenceChar.repeat(t.fenceLength),start:r,content:[],lang:t.lang,attrs:i,attrsRange:i&&s>=0?[r+s,r+s+i.length]:null,valueRangeStart:c};let l=e.replace(/\s*\{[^}]+\}\s*$/,``);n.push(l)}return!0}function c(e,n,r){let i=E(e);return t.push({type:`prefix`,prefix:i.prefix,iri:i.iri}),!0}function l(e,r,i){let a=D(e),o=a.attrs,s=a.depth,c=re(e,o,r,s,a.content.length);t.push(R(`heading`,[r,i-1],a.content,o,c.attrsRange,c.valueRange,{depth:a.depth}));let l=`${`#`.repeat(a.depth)} ${a.content}`;return n.push(l),!0}function u(e,r,i){let a=ee(e),o=` `.repeat(a.indent),s=[e,o,a.marker,a.content,a.attrs];t.push(ie(`list`,e,r,i,s));let c=`${o}${a.marker} ${a.content}`;return n.push(c),!0}function d(e,r,i){let a=O(e),o=a.attrs,s=e.startsWith(`> `)?2:e.indexOf(`>`)+1,c=s+a.content.length;t.push(R(`blockquote`,[r,i-1],a.content,o,L(e,o,r),[r+s,r+c]));let l=`> ${a.content}`;return n.push(l),!0}function f(e,r,i){t.push(R(`para`,[r,i-1],e.trim()));let a=e,o=F(a,0);for(let e of o)if(e.attrs&&(e.type===`emphasis`||e.type===`code`)){let t=a.substring(0,e.range[0]),n=a.substring(e.range[1]);a=t+(e.text||``)+n}return a=a.replace(/\[([^\]]+)\]\s*\{[^}]+\}/g,`$1`),a=a.replace(/\s*\{[^}]+\}\s*/g,` `),a=a.replace(/\s+/g,` `).trim(),n.push(a),!0}function p(e,n,r){return t.push({type:`standalone`,text:e.trim(),range:[n,r-1]}),!0}for(let e=0;e<r.length;e++){let t=r[e],n=i;i+=t.length+1;for(let e of o)if(e.test(t)&&e.process(t,n,i))break}return{tokens:t,md:n.join(`
|
|
36
|
-
`)}}function Ce(e,t=0){return F(e,t)}function we(e,t){let n=e._blockId||g(`${e.type}:${e.range?.[0]}:${e.range?.[1]}`);e._blockId=n;let r=xe(e),i=se(e),a={id:n,type:e.type,range:e.range,text:i,subject:null,types:[],predicates:[],carriers:[],listLevel:e.indent||0,parentBlockId:t.blockStack.length>0?t.blockStack[t.blockStack.length-1]:null,quadKeys:[]};for(let e of r){let t={type:e.type,range:e.range,text:e.text,subject:null,predicates:[],sem:null};if(e.attrs){let n=oe(e.attrs);t.sem=n,t.predicates=n.predicates||[],t.subject=n.subject,t.types=n.types||[]}a.carriers.push(t)}return t.origin.blocks.set(n,a),t.origin.documentStructure.push(a),a}function Te(e,t,n,r){if(t.subject&&t.subject!==`RESET`){let n=ue(t,r);n&&(e.subject=n.value)}if(t.types&&t.types.length>0&&t.types.forEach(t=>{let n=v(typeof t==`string`?t:t.iri,r.ctx);e.types.includes(n)||e.types.push(n)}),t.predicates&&t.predicates.length>0&&t.predicates.forEach(t=>{let n={iri:v(t.iri,r.ctx),form:t.form||``,object:null};e.predicates.push(n)}),n){let t={type:n.type,range:n.range,text:n.text,subject:null,predicates:[]};if(n.attrs){let e=oe(n.attrs);t.sem=e,t.predicates=e.predicates||[],t.subject=e.subject,t.types=e.types||[]}e.carriers.push(t)}}function Ee(e,t,n,r={}){let{preserveGlobalSubject:i=!1,implicitSubject:a=null}=r;if(t.subject===`RESET`){n.currentSubject=null;return}let o=n.currentSubject,s=ue(t,n),c=de(t,n);s&&!n.primarySubject&&!t.subject.startsWith(`=#`)&&(n.primarySubject=s.value),s&&!i&&!a&&(n.currentSubject=s);let l=i?s||o:a||n.currentSubject;if(!l)return;let u=De(l.value,t.types,t.predicates,e.range,e.attrsRange||null,e.valueRange||null,e.type||null,n.ctx,e.text),d=w(e.text,t.datatype,t.language,n.ctx,n.df),f=e.url?n.df.namedNode(v(e.url,n.ctx)):null,p=s||f;n.currentBlock&&Te(n.currentBlock,t,e,n),je(t,s,c,f,l,u,n,e),Ne(t,s,o,c,p,l,d,u,n,e)}function De(e,t,n,r,i,a,o,s,c){let l={subject:e,types:t.map(e=>v(typeof e==`string`?e:e.iri,s)),predicates:n.map(e=>({iri:v(e.iri,s),form:e.form}))};return{id:g([e,o||`unknown`,l.types.join(`,`),l.predicates.map(e=>`${e.form}${e.iri}`).join(`,`)].join(`|`)),range:{start:r[0],end:r[1]},carrierType:o||null,subject:e,types:l.types,predicates:l.predicates,context:s,text:c||``}}function Oe(e,t,n,r,i,a,o,s,c,l=null,u=null,d=null,f=null){if(!a||!o||!s)return;let p=c.quad(a,o,s);if(l?.remove){let i=S(p.subject,p.predicate,p.object);if(t.has(i)){t.delete(i);let n=e.findIndex(e=>e.subject.value===p.subject.value&&e.predicate.value===p.predicate.value&&e.object.value===p.object.value);n!==-1&&e.splice(n,1),r.delete(i)}else n.add(p)}else{let n=S(p.subject,p.predicate,p.object);t.set(n,p),e.push(p),f&&(!f.primaryType&&o.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`&&(f.primaryType=s.value),!f.primaryLabel&&o.value===`http://www.w3.org/2000/01/rdf-schema#label`&&s.termType===`Literal`&&(f.primaryLabel=s.value)),ke(p,c,l,u,d);let m=ce(i,a,o,l);r.set(n,m),f.currentBlock&&i.id===f.currentBlock.id&&(f.currentBlock.quadKeys||(f.currentBlock.quadKeys=[]),f.currentBlock.quadKeys.push(n))}}function ke(e,t,n,r=null,i=null){if(!r||!i)return;let a=e.predicate.value;if(a!==`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`&&a!==`http://www.w3.org/1999/02/22-rdf-syntax-ns#subject`&&a!==`http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate`&&a!==`http://www.w3.org/1999/02/22-rdf-syntax-ns#object`)return;if(a===`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`&&e.object.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement`){i.set(e.subject.value,{spo:{}});return}let o=i.get(e.subject.value);if(o&&(a===`http://www.w3.org/1999/02/22-rdf-syntax-ns#subject`?o.spo.subject=e.object:a===`http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate`?o.spo.predicate=e.object:a===`http://www.w3.org/1999/02/22-rdf-syntax-ns#object`&&(o.spo.object=e.object,o.objectQuad=e),o.spo.subject&&o.spo.predicate&&o.spo.object)){let n=t.quad(o.spo.subject,o.spo.predicate,o.spo.object);r.push(n),i.delete(e.subject.value)}}var Ae=(e,t,n,r,i=null)=>{let a=v(e,n.ctx),o=typeof i==`object`?i:{entryIndex:i,remove:!1};Oe(n.quads,n.quadBuffer,n.removeSet,n.origin.quadIndex,r,t,n.df.namedNode(v(`rdf:type`,n.ctx)),n.df.namedNode(a),n.df,{kind:`type`,token:`.${e}`,expandedType:a,entryIndex:o.entryIndex,remove:o.remove},n.statements,n.statementCandidates,n)};function je(e,t,n,r,i,a,o,s){e.types.forEach(e=>{Ae(typeof e==`string`?e:e.iri,t||n||r||i,o,a,typeof e==`string`?{entryIndex:null,remove:!1}:e)})}var Me=(e,t,n,r,i,a,o,s)=>{if(e.form===``&&t?.type===`link`&&t?.url&&t.text===t.url)return null;switch(e.form){case``:return n?{subject:i||o,object:s}:t?.type===`link`&&t?.url&&t.text!==t.url?{subject:a,object:s}:{subject:i||o,object:s};case`?`:return{subject:n?r:o,object:i||a};case`!`:return{subject:i||a,object:n?r:o};default:return null}};function Ne(e,t,n,r,i,a,o,s,c,l){e.predicates.forEach(e=>{let u=Me(e,l,t,n,r,i,a,o);if(u){let t=c.df.namedNode(v(e.iri,c.ctx));Oe(c.quads,c.quadBuffer,c.removeSet,c.origin.quadIndex,s,u.subject,t,u.object,c.df,{kind:`pred`,token:`${e.form}${e.iri}`,form:e.form,expandedPredicate:t.value,entryIndex:e.entryIndex,remove:e.remove||!1},c.statements,c.statementCandidates,c)}})}function Pe(e,t,n,r={}){Ee(e,t,n,r)}function Fe(e,t,n){if(e.attrs){let r=oe(e.attrs);Pe({type:n,text:e.text,range:e.range,attrsRange:e.attrsRange||null,valueRange:e.valueRange||null},r,t)}xe(e).forEach(e=>{e.attrs&&Pe(e,oe(e.attrs),t)})}function Ie(e,t){let n=k(e.text);if(!n)return;let r=oe(`{=${n.content}}`),i=e.range[0]+e.text.indexOf(`{=`);Pe({type:`standalone`,text:``,range:e.range,attrsRange:[i,i+(n.content?n.content.length:0)],valueRange:null},r,t)}var Le={heading:(e,t)=>_e(e,t,Fe,we),code:(e,t)=>_e(e,t,Fe,we),blockquote:(e,t)=>_e(e,t,Fe,we),para:(e,t)=>_e(e,t,Fe,we,[Ie]),list:(e,t)=>_e(e,t,Fe,we),standalone:(e,t)=>Ie(e,t)};function Re(e){return C(e)}function ze(e,t,n){return typeof e==`string`?H({text:e,...t,context:{...n,...t.context}}):e}function U(e,t={}){let n=new Map,i=new Set,a=[],o=new Map,s=[],c=new Map,l=[];for(let
|
|
37
|
-
`);let c=Array.from(e.keys()).sort(),l=n,u=l?[l,...c.filter(e=>e!==l)]:c;for(let n of u){let r=e.get(n);if(!r)continue;let a=He(n,t),{types:s,literals:c,objects:l}=be(r),u=o.has(n),d=u?o.get(n):Ue(n,t),f=s.length>0?s.map(e=>`.`+He(e.object.value,t)).sort().join(` `):``;u&&(f+=(f?` `:``)+`label`);let p=f?` `+f:``;i.push(`# ${d} {=${a}${p}}\n
|
|
36
|
+
`)}}function Ce(e,t=0){return F(e,t)}function we(e,t){let n=e._blockId||g(`${e.type}:${e.range?.[0]}:${e.range?.[1]}`);e._blockId=n;let r=xe(e),i=se(e),a={id:n,type:e.type,range:e.range,text:i,subject:null,types:[],predicates:[],carriers:[],listLevel:e.indent||0,parentBlockId:t.blockStack.length>0?t.blockStack[t.blockStack.length-1]:null,quadKeys:[]};for(let e of r){let t={type:e.type,range:e.range,text:e.text,subject:null,predicates:[],sem:null};if(e.attrs){let n=oe(e.attrs);t.sem=n,t.predicates=n.predicates||[],t.subject=n.subject,t.types=n.types||[]}a.carriers.push(t)}return t.origin.blocks.set(n,a),t.origin.documentStructure.push(a),a}function Te(e,t,n,r){if(t.subject&&t.subject!==`RESET`){let n=ue(t,r);n&&(e.subject=n.value)}if(t.types&&t.types.length>0&&t.types.forEach(t=>{let n=v(typeof t==`string`?t:t.iri,r.ctx);e.types.includes(n)||e.types.push(n)}),t.predicates&&t.predicates.length>0&&t.predicates.forEach(t=>{let n={iri:v(t.iri,r.ctx),form:t.form||``,object:null};e.predicates.push(n)}),n){let t={type:n.type,range:n.range,text:n.text,subject:null,predicates:[]};if(n.attrs){let e=oe(n.attrs);t.sem=e,t.predicates=e.predicates||[],t.subject=e.subject,t.types=e.types||[]}e.carriers.push(t)}}function Ee(e,t,n,r={}){let{preserveGlobalSubject:i=!1,implicitSubject:a=null}=r;if(t.subject===`RESET`){n.currentSubject=null;return}let o=n.currentSubject,s=ue(t,n),c=de(t,n);s&&!n.primarySubject&&!t.subject.startsWith(`=#`)&&(n.primarySubject=s.value),s&&!i&&!a&&(n.currentSubject=s);let l=i?s||o:a||n.currentSubject;if(!l)return;let u=De(l.value,t.types,t.predicates,e.range,e.attrsRange||null,e.valueRange||null,e.type||null,n.ctx,e.text),d=w(e.text,t.datatype,t.language,n.ctx,n.df),f=e.url?n.df.namedNode(v(e.url,n.ctx)):null,p=s||f;n.currentBlock&&Te(n.currentBlock,t,e,n),je(t,s,c,f,l,u,n,e),Ne(t,s,o,c,p,l,d,u,n,e)}function De(e,t,n,r,i,a,o,s,c){let l={subject:e,types:t.map(e=>v(typeof e==`string`?e:e.iri,s)),predicates:n.map(e=>({iri:v(e.iri,s),form:e.form}))};return{id:g([e,o||`unknown`,l.types.join(`,`),l.predicates.map(e=>`${e.form}${e.iri}`).join(`,`)].join(`|`)),range:{start:r[0],end:r[1]},carrierType:o||null,subject:e,types:l.types,predicates:l.predicates,context:s,text:c||``}}function Oe(e,t,n,r,i,a,o,s,c,l=null,u=null,d=null,f=null){if(!a||!o||!s)return;let p=c.quad(a,o,s);if(l?.remove){let i=S(p.subject,p.predicate,p.object);if(t.has(i)){t.delete(i);let n=e.findIndex(e=>e.subject.value===p.subject.value&&e.predicate.value===p.predicate.value&&e.object.value===p.object.value);n!==-1&&e.splice(n,1),r.delete(i)}else n.add(p)}else{let n=S(p.subject,p.predicate,p.object);t.set(n,p),e.push(p),f&&(!f.primaryType&&o.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`&&(f.primaryType=s.value),!f.primaryLabel&&o.value===`http://www.w3.org/2000/01/rdf-schema#label`&&s.termType===`Literal`&&(f.primaryLabel=s.value),!f.primaryComment&&o.value===`http://www.w3.org/2000/01/rdf-schema#comment`&&s.termType===`Literal`&&(f.primaryComment=s.value)),ke(p,c,l,u,d);let m=ce(i,a,o,l);r.set(n,m),f.currentBlock&&i.id===f.currentBlock.id&&(f.currentBlock.quadKeys||(f.currentBlock.quadKeys=[]),f.currentBlock.quadKeys.push(n))}}function ke(e,t,n,r=null,i=null){if(!r||!i)return;let a=e.predicate.value;if(a!==`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`&&a!==`http://www.w3.org/1999/02/22-rdf-syntax-ns#subject`&&a!==`http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate`&&a!==`http://www.w3.org/1999/02/22-rdf-syntax-ns#object`)return;if(a===`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`&&e.object.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement`){i.set(e.subject.value,{spo:{}});return}let o=i.get(e.subject.value);if(o&&(a===`http://www.w3.org/1999/02/22-rdf-syntax-ns#subject`?o.spo.subject=e.object:a===`http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate`?o.spo.predicate=e.object:a===`http://www.w3.org/1999/02/22-rdf-syntax-ns#object`&&(o.spo.object=e.object,o.objectQuad=e),o.spo.subject&&o.spo.predicate&&o.spo.object)){let n=t.quad(o.spo.subject,o.spo.predicate,o.spo.object);r.push(n),i.delete(e.subject.value)}}var Ae=(e,t,n,r,i=null)=>{let a=v(e,n.ctx),o=typeof i==`object`?i:{entryIndex:i,remove:!1};Oe(n.quads,n.quadBuffer,n.removeSet,n.origin.quadIndex,r,t,n.df.namedNode(v(`rdf:type`,n.ctx)),n.df.namedNode(a),n.df,{kind:`type`,token:`.${e}`,expandedType:a,entryIndex:o.entryIndex,remove:o.remove},n.statements,n.statementCandidates,n)};function je(e,t,n,r,i,a,o,s){e.types.forEach(e=>{Ae(typeof e==`string`?e:e.iri,t||n||r||i,o,a,typeof e==`string`?{entryIndex:null,remove:!1}:e)})}var Me=(e,t,n,r,i,a,o,s)=>{if(e.form===``&&t?.type===`link`&&t?.url&&t.text===t.url)return null;switch(e.form){case``:return n?{subject:i||o,object:s}:t?.type===`link`&&t?.url&&t.text!==t.url?{subject:a,object:s}:{subject:i||o,object:s};case`?`:return{subject:n?r:o,object:i||a};case`!`:return{subject:i||a,object:n?r:o};default:return null}};function Ne(e,t,n,r,i,a,o,s,c,l){e.predicates.forEach(e=>{let u=Me(e,l,t,n,r,i,a,o);if(u){let t=c.df.namedNode(v(e.iri,c.ctx));Oe(c.quads,c.quadBuffer,c.removeSet,c.origin.quadIndex,s,u.subject,t,u.object,c.df,{kind:`pred`,token:`${e.form}${e.iri}`,form:e.form,expandedPredicate:t.value,entryIndex:e.entryIndex,remove:e.remove||!1},c.statements,c.statementCandidates,c)}})}function Pe(e,t,n,r={}){Ee(e,t,n,r)}function Fe(e,t,n){if(e.attrs){let r=oe(e.attrs);Pe({type:n,text:e.text,range:e.range,attrsRange:e.attrsRange||null,valueRange:e.valueRange||null},r,t)}xe(e).forEach(e=>{e.attrs&&Pe(e,oe(e.attrs),t)})}function Ie(e,t){let n=k(e.text);if(!n)return;let r=oe(`{=${n.content}}`),i=e.range[0]+e.text.indexOf(`{=`);Pe({type:`standalone`,text:``,range:e.range,attrsRange:[i,i+(n.content?n.content.length:0)],valueRange:null},r,t)}var Le={heading:(e,t)=>_e(e,t,Fe,we),code:(e,t)=>_e(e,t,Fe,we),blockquote:(e,t)=>_e(e,t,Fe,we),para:(e,t)=>_e(e,t,Fe,we,[Ie]),list:(e,t)=>_e(e,t,Fe,we),standalone:(e,t)=>Ie(e,t)};function Re(e){return C(e)}function ze(e,t,n){return typeof e==`string`?H({text:e,...t,context:{...n,...t.context}}):e}function U(e,t={}){let n=new Map,i=new Set,a=[],o=new Map,s=[],c=new Map,l=[],u=[];for(let d=0;d<e.length;d++){let f=e[d],p=ze(f,t,{...r,...t.context});if(p.context)for(let[e,t]of Object.entries(p.context))!c.has(e)&&!r[e]&&c.set(e,t);let m={index:d,input:typeof f==`string`?`string`:`ParseResult`,origin:p.origin,context:p.context,statementsCount:p.statements?.length||0};a.push(m),p.statements&&p.statements.length>0&&s.push(...p.statements),p.primary&&(p.primary.subject||p.primary.type||p.primary.label)&&l.push(p.primary),p.primarySubject&&u.push(p.primarySubject);for(let e of p.quads){let t=Re(e);n.set(t,e);let r=p.origin.quadIndex.get(t);o.set(t,{...r||{},documentIndex:d,polarity:`+`})}for(let e of p.remove){let t=Re(e);n.has(t)?n.delete(t):i.add(e);let r=p.origin.quadIndex.get(t);o.set(t,{...r||{},documentIndex:d,polarity:`-`})}}let d=Array.from(n.values()),f=Array.from(i),p={documents:a,quadIndex:o},m={...r,...t.context,...Object.fromEntries(c)},h=new Set(d.map(Re)),g=new Set(f.map(Re));return{quads:d.filter(e=>!g.has(Re(e))),remove:f.filter(e=>!h.has(Re(e))),statements:s,origin:p,context:m,primarySubjects:u,primary:l}}var Be=new Map,Ve=1e3;function He(e,t){let n=`${e}|${JSON.stringify(t)}`;if(Be.has(n))return Be.get(n);let r=y(e,t);return Be.size>=Ve&&Array.from(Be.keys()).slice(0,Math.floor(Ve/2)).forEach(e=>Be.delete(e)),Be.set(n,r),r}function Ue(e,t={}){if(!e)return e;for(let[n,r]of Object.entries(t))if(e.startsWith(r)||e.startsWith(r.slice(0,-1)))return e.substring(r.length);for(let t of[`#`,`/`,`:`]){let n=e.lastIndexOf(t);if(n!==-1&&n<e.length-1)return e.substring(n+1)}return e}function We({quads:e,context:t={},primarySubject:n=null}){let i=Object.assign({},r,t),a=Ge(e),o=Ke(a),s=n;!s&&a.length>0&&(s=a[0].subject.value);let{text:c}=qe(o,i,s);return{text:c,context:i}}function Ge(e){return!e||e.length===0?[]:e.map(e=>e.subject.termType&&e.predicate.termType&&e.object.termType?e:{subject:m.fromTerm(e.subject),predicate:m.fromTerm(e.predicate),object:m.fromTerm(e.object)}).sort((e,t)=>{let n=e.subject.value.localeCompare(t.subject.value);if(n!==0)return n;let r=e.predicate.value.localeCompare(t.predicate.value);if(r!==0)return r;let i=(fe(e.object),e.object.value),a=(fe(t.object),t.object.value);return i.localeCompare(a)})}function Ke(e){let t=new Map;for(let n of e){let e=n.subject.value,r=t.get(e);r?r.push(n):t.set(e,[n])}return t}function qe(e,t,n=null){let i=[],a=ge(e,t),o=Je(e),s=Object.entries(t).sort(([e],[t])=>e.localeCompare(t));for(let[e,t]of s)e!==`@vocab`&&!e.startsWith(`@`)&&!r[e]&&a.has(e)&&i.push(ve(e,t));s.length>0&&i.push(`
|
|
37
|
+
`);let c=Array.from(e.keys()).sort(),l=n,u=l?[l,...c.filter(e=>e!==l)]:c;for(let n of u){let r=e.get(n);if(!r)continue;let a=He(n,t),{types:s,literals:c,objects:l}=be(r),u=o.has(n),d=u?o.get(n):Ue(n,t),f=s.length>0?s.map(e=>`.`+He(e.object.value,t)).sort().join(` `):``;u&&(f+=(f?` `:``)+`label`);let p=f?` `+f:``;i.push(`# ${d} {=${a}${p}}\n`);let m=u?o.get(n):null;B(c).forEach(e=>{e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#label`&&e.object.value===m||i.push(V(e,t))}),B(l).forEach(e=>{i.push(ye(e,t,o))}),i.push(`
|
|
38
38
|
`)}return{text:i.join(``)}}function Je(e){let t=new Map;for(let n of e.values())for(let e of n)e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#label`&&e.object.termType===`Literal`&&t.set(e.subject.value,e.object.value);return t}function W(e){return String(e).replaceAll(`&`,`&`).replaceAll(`<`,`<`).replaceAll(`>`,`>`).replaceAll(`"`,`"`).replaceAll(`'`,`'`)}var G={text:`#6b7280`,marker:`#f97316`,retraction:`#dc2626`,value:`#eab308`,annotation:`#4b5563`};function Ye(e,t){let n=t;for(;n<e.length&&e[n]!==`
|
|
39
39
|
`&&e[n]!==`\r`;){if(e[n]===`{`)return!0;n++}return!1}function Xe(e,t){let n=e[t];if(n===`*`&&t+1<e.length&&e[t+1]===`*`){let n=e.indexOf(`**`,t+2);if(n!==-1){let r=e.slice(t+2,n),i=Ye(e,n+2)?` style="color: ${G.marker}"`:``;return{html:`<span${i}>**</span><strong>${W(r)}</strong><span${i}>**</span>`,nextIndex:n+2}}}if(n===`_`&&t+1<e.length&&e[t+1]===`_`){let n=e.indexOf(`__`,t+2);if(n!==-1){let r=e.slice(t+2,n),i=Ye(e,n+2)?` style="color: ${G.marker}"`:``;return{html:`<span${i}>__</span><strong>${W(r)}</strong><span${i}>__</span>`,nextIndex:n+2}}}if(n===`*`){let n=e.indexOf(`*`,t+1);if(n!==-1){let r=e.slice(t+1,n),i=Ye(e,n+1)?` style="color: ${G.marker}"`:``;return{html:`<span${i}>*</span><em>${W(r)}</em><span${i}>*</span>`,nextIndex:n+1}}}if(n===`_`){let n=e.indexOf(`_`,t+1);if(n!==-1){let r=e.slice(t+1,n),i=Ye(e,n+1)?` style="color: ${G.marker}"`:``;return{html:`<span${i}>_</span><em>${W(r)}</em><span${i}>_</span>`,nextIndex:n+1}}}if(n==="`"){let n=e.indexOf("`",t+1);if(n!==-1){let r=e.slice(t+1,n),i=Ye(e,n+1)?` style="color: ${G.marker}"`:``;return{html:`<span${i}>\`</span><code style="background-color:#7773">${W(r)}</code><span${i}>\`</span>`,nextIndex:n+1}}}return null}var Ze=new Map;function Qe(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r,t&=t}return Math.abs(t)}function $e(e){if(Ze.has(e))return Ze.get(e);let t=Qe(e),n=`hsl(${t%360}, ${15+t%10}%, ${45+t%10}%)`;return Ze.set(e,n),n}function et(e){let t=new Map,n=/^\[(\w+)\]\s*<([^>]*)>\s*$/gm,i;for(;(i=n.exec(e))!==null;){let e=i[1],n=i[2];if(n.includes(`:`)){let e=n.indexOf(`:`);if(e>0){let r=n.slice(0,e),i=n.slice(e+1);t.has(r)&&(n=t.get(r)+i)}}t.set(e,n)}for(let[e,n]of Object.entries(r))e!==`@vocab`&&t.set(e,n);return t}function tt(e,t,n){let r=t?G.retraction:G.text,i=e.indexOf(`:`);if(i>0){let t=e.slice(0,i),r=e.slice(i+1);if(n.has(t)){let e=n.get(t),i=$e(e),a=e+r,o=$e(a);return`<span style="color: ${i}">${W(t)}</span><span style="color: ${G.marker}">:</span><span data-iri="${a}" style="color: ${o}">${W(r)}</span> `}}return e.startsWith(`http:`)||e.startsWith(`https:`)||e.startsWith(`tag:`)||e.startsWith(`urn:`)?`<span style="color: ${$e(e)}">${W(e)}</span> `:`<span style="color: ${r}">${W(e)}</span> `}function nt(e,t){let n=e.trim().split(/\s+/),r=``,i=!1;for(let e=0;e<n.length;e++){let a=n[e];if(!a)continue;if(a.startsWith(`=`)||a.startsWith(`+`)){let e=a[0],n=a.slice(1);r+=`<span style="color: ${G.marker}">${W(e)}</span>${tt(n,!1,t)}`;continue}if(a===`-`){i=!0,r+=`<span style="color: ${G.retraction}">${W(a)}</span> `;continue}if(a.startsWith(`-`)&&a.length>1){r+=`<span style="color: ${G.retraction}">${W(a)}</span> `;continue}let o=i;if(i=!1,a.startsWith(`?`)||a.startsWith(`!`)){let e=a[0],n=a.slice(1),i=o?G.retraction:G.marker;r+=`<span style="color: ${i}">${W(e)}</span>${tt(n,o,t)}`;continue}if(a.startsWith(`^^`)){let e=a.slice(2),n=o?G.retraction:G.marker;r+=`<span style="color: ${n}">${W(`^^`)}</span>${tt(e,o,t)}`;continue}if(a.startsWith(`@`)){let e=a.slice(1),n=o?G.retraction:G.marker;r+=`<span style="color: ${n}">${W(`@`)}</span>${tt(e,o,t)}`;continue}if(a.startsWith(`.`)){let e=a.slice(1),n=o?G.retraction:G.marker;r+=`<span style="color: ${n}">${W(`.`)}</span>${tt(e,o,t)}`;continue}r+=tt(a,o,t)}return r.trim()}function rt(e){let t=et(e),n=``,r=0;for(;r<e.length;){let i=e[r];if(i===`{`){let a=e.indexOf(`}`,r);if(a===-1){n+=W(i),r++;continue}let o=nt(e.slice(r+1,a),t);n+=`<span style="color: ${G.annotation}; opacity: 0.75">{</span>`,n+=o,n+=`<span style="color: ${G.annotation}; opacity: 0.75">}</span>`,r=a+1;continue}if(i===`[`){let a=e.indexOf(`]`,r);if(a===-1){n+=W(i),r++;continue}let o=e.slice(r+1,a),s=a+1;for(;s<e.length&&/\s/.test(e[s]);)s++;if(s<e.length&&e[s]===`<`){let i=e.indexOf(`>`,s);if(i!==-1){let a=e.slice(s+1,i),c=t.has(o)?$e(t.get(o)):G.text;n+=`<span style="color: ${G.annotation}; opacity: 0.75">[</span><span style="color: ${c}">${W(o)}</span><span style="color: ${G.annotation}; opacity: 0.75">]</span> <span style="color: ${G.text}; opacity: 0.6"><${W(a)}></span>`,r=i+1;continue}}let c=e.slice(r+1,a),l=Ye(e,a+1)?G.marker:G.value,u=W(c);n+=`<span style="color: ${l}; opacity: 0.85">[</span><span style=" opacity: 1.0">${u}</span><span style="color: ${l}; opacity: 0.85">]</span>`,r=a+1;continue}if(i===`*`||i===`_`||i==="`"){let t=Xe(e,r);if(t){n+=t.html,r=t.nextIndex;continue}}if(i===`#`){let i=0,a=r;for(;a<e.length&&e[a]===`#`;)i++,a++;if(i<=6&&(a>=e.length||e[a]===` `||e[a]===` `)){let o=e.indexOf(`
|
|
40
40
|
`,a),s=o===-1?e.length:o,c=e.slice(a,s).trim(),l=``,u=0,d=c.indexOf(`{`);for(;d!==-1;){let e=c.indexOf(`}`,d);if(e===-1)break;let n=c.slice(u,d);l+=W(n);let r=nt(c.slice(d+1,e),t);l+=`<span style="color: ${G.annotation}; opacity: 0.75">{</span>`+r+`<span style="color: ${G.annotation}; opacity: 0.75">}</span>`,u=e+1,d=c.indexOf(`{`,u)}l+=W(c.slice(u));let f=c.includes(`{`)&&c.includes(`}`),p=`h${i}`,m=`#`.repeat(i),h=f?`color: ${G.marker}; opacity: 0.8`:``;n+=`<${p} style="margin: 0; font-weight: 600;"><span style="${h}">${m}</span> ${l}</${p}>`,r=s;continue}}if(i===`-`||i===`*`){let t=r>0?e[r-1]:`
|
|
41
41
|
`;if((t===`
|
|
42
42
|
`||t===`\r`||t===` `||t===` `)&&e[r+1]===` `){let t=Ye(e,r+2)?`color: ${G.marker}; opacity: 0.85`:``;n+=`<span style="${t}">${W(i)}</span>`,r++;continue}}if(i===`>`){let t=r>0?e[r-1]:`
|
|
43
43
|
`;if((t===`
|
|
44
|
-
`||t===`\r`||t===` `||t===` `)&&e[r+1]===` `){let t=Ye(e,r+2)?`color: ${G.marker}; opacity: 0.85`:``;n+=`<span style="${t}">${W(i)}</span>`,r++;continue}}n+=W(i),r++}return n}function K(e,t){if(!e)throw Error(t)}function it(e,t,n,r){return e.find(e=>e.subject.value===t&&e.predicate.value===n&&(r===null||(e.object.termType,e.object.value===r)))}function q(e,t,n,r){return!!it(e,t,n,r)}var at=[{name:`Primary subject - first subject declaration`,fn:()=>{let{primarySubject:e}=H({text:`[ex] <http://example.org/>
|
|
44
|
+
`||t===`\r`||t===` `||t===` `)&&e[r+1]===` `){let t=Ye(e,r+2)?`color: ${G.marker}; opacity: 0.85`:``;n+=`<span style="${t}">${W(i)}</span>`,r++;continue}}n+=W(i),r++}return n}function K(e,t){if(!e)throw Error(t)}function it(e,t,n,r){return e.find(e=>e.subject.value===t&&e.predicate.value===n&&(r===null||(e.object.termType,e.object.value===r)))}function q(e,t,n,r){return!!it(e,t,n,r)}var at=[{name:`Primary subject - first subject declaration`,fn:()=>{let{primarySubject:e,primary:t}=H({text:`[ex] <http://example.org/>
|
|
45
45
|
|
|
46
46
|
# Document {=ex:doc .ex:Article label}
|
|
47
|
-
[Alice] {ex:author}`});K(e!==null,`Should have a primary subject`),K(e===`http://example.org/doc`,`Primary subject should be ex:doc, got ${e}`)}},{name:`Primary subject - null when no subject declared`,fn:()=>{let{primarySubject:e}=H({text:`[Alice] {label}`});K(e===null,`Primary subject should be null when no subject declared`)}},{name:`Primary subject - fragment does not become primary`,fn:()=>{let{primarySubject:e}=H({text:`[ex] <http://example.org/>
|
|
47
|
+
[Alice] {ex:author}`});K(e!==null,`Should have a primary subject`),K(e===`http://example.org/doc`,`Primary subject should be ex:doc, got ${e}`),K(t!==null,`Should have a primary object`),K(t.subject===`http://example.org/doc`,`Primary object subject should be ex:doc, got ${t.subject}`),K(t.type===`http://example.org/Article`,`Primary object type should be ex:Article, got ${t.type}`),K(t.label===`Document`,`Primary object label should be Document, got ${t.label}`)}},{name:`Primary subject - null when no subject declared`,fn:()=>{let{primarySubject:e,primary:t}=H({text:`[Alice] {label}`});K(e===null,`Primary subject should be null when no subject declared`),K(t!==null,`Primary object should exist even when no subject declared`),K(t.subject===null,`Primary object subject should be null when no subject declared`),K(t.type===null,`Primary object type should be null when no subject declared`),K(t.label===null,`Primary object label should be null when no label exists`)}},{name:`Primary subject - fragment does not become primary`,fn:()=>{let{primarySubject:e,primary:t}=H({text:`[ex] <http://example.org/>
|
|
48
48
|
|
|
49
49
|
# Document {=ex:doc}
|
|
50
50
|
{=#summary}
|
|
51
|
-
[Content] {label}`});K(e!==null,`Should have a primary subject`),K(e===`http://example.org/doc`,`Primary subject should be ex:doc, not fragment`)}},{name:`Primary subject - reset does not clear primary`,fn:()=>{let{primarySubject:e}=H({text:`[ex] <http://example.org/>
|
|
51
|
+
[Content] {label}`});K(e!==null,`Should have a primary subject`),K(e===`http://example.org/doc`,`Primary subject should be ex:doc, not fragment`),K(t!==null,`Should have a primary object`),K(t.subject===`http://example.org/doc`,`Primary object subject should be ex:doc, not fragment`)}},{name:`Primary subject - reset does not clear primary`,fn:()=>{let{primarySubject:e,primary:t}=H({text:`[ex] <http://example.org/>
|
|
52
52
|
|
|
53
53
|
# First {=ex:first}
|
|
54
54
|
[Value] {label}
|
|
@@ -56,16 +56,16 @@
|
|
|
56
56
|
# Reset {=}
|
|
57
57
|
|
|
58
58
|
# Second {=ex:second}
|
|
59
|
-
[Value] {label}`});K(e!==null,`Should have a primary subject`),K(e===`http://example.org/first`,`Primary subject should remain ex:first after reset, got ${e}`)}},{name:`Primary subject - first non-fragment subject wins`,fn:()=>{let{primarySubject:e}=H({text:`[ex] <http://example.org/>
|
|
59
|
+
[Value] {label}`});K(e!==null,`Should have a primary subject`),K(e===`http://example.org/first`,`Primary subject should remain ex:first after reset, got ${e}`),K(t!==null,`Should have a primary object`),K(t.subject===`http://example.org/first`,`Primary object subject should be ex:first after reset, got ${t.subject}`)}},{name:`Primary subject - first non-fragment subject wins`,fn:()=>{let{primarySubject:e,primary:t}=H({text:`[ex] <http://example.org/>
|
|
60
60
|
|
|
61
61
|
{=#summary}
|
|
62
62
|
[Content] {label}
|
|
63
63
|
|
|
64
64
|
# Document {=ex:doc}
|
|
65
|
-
[Alice] {ex:author}`});K(e!==null,`Should have a primary subject`),K(e===`http://example.org/doc`,`Primary subject should be ex:doc, not fragment`)}},{name:`Primary subject - round-trip with generate()`,fn:()=>{let{quads:e,primarySubject:t}=H({text:`[ex] <http://example.org/>
|
|
65
|
+
[Alice] {ex:author}`});K(e!==null,`Should have a primary subject`),K(e===`http://example.org/doc`,`Primary subject should be ex:doc, not fragment`),K(t!==null,`Should have a primary object`),K(t.subject===`http://example.org/doc`,`Primary object subject should be ex:doc, not fragment`)}},{name:`Primary subject - round-trip with generate()`,fn:()=>{let{quads:e,primarySubject:t,primary:n}=H({text:`[ex] <http://example.org/>
|
|
66
66
|
|
|
67
67
|
# Document {=ex:doc .ex:Article label}
|
|
68
|
-
[Alice] {ex:author}`}),
|
|
68
|
+
[Alice] {ex:author}`}),r=We({quads:e,context:{ex:`http://example.org/`},primarySubject:t}),{primarySubject:i,primary:a}=H({text:r.text,context:r.context});K(t!==null,`Original should have primary subject`),K(n!==null,`Original should have primary object`),K(i!==null,`Regenerated should have primary subject`),K(a!==null,`Regenerated should have primary object`),K(t===i,`Primary subject should be preserved in round-trip: ${t} vs ${i}`),K(n.subject===a.subject,`Primary object subject should be preserved: ${n.subject} vs ${a.subject}`),K(n.type===a.type,`Primary object type should be preserved: ${n.type} vs ${a.type}`),K(n.label===a.label,`Primary object label should be preserved: ${n.label} vs ${a.label}`)}},{name:`Subject declaration sets context`,fn:()=>{let{quads:e,context:t}=H({text:`[ex] <http://example.org/>
|
|
69
69
|
# Title {=ex:doc}
|
|
70
70
|
|
|
71
71
|
[value] {label}`});K(q(e,`http://example.org/doc`,`http://www.w3.org/2000/01/rdf-schema#label`,`value`),`Subject should be ex:doc`)}},{name:`Subject reset with {=}`,fn:()=>{let{quads:e}=H({text:`[ex] <http://example.org/>
|
|
@@ -549,7 +549,7 @@ List items:
|
|
|
549
549
|
|
|
550
550
|
[Alice Smith] {author}`}),t=h(e.quads.find(e=>e.subject.value===`http://example.org/article`&&e.predicate.value===`http://www.w3.org/2000/01/rdf-schema#author`),e.origin);ot(t,`Should locate quad`),ot(t.range.start>=0,`Range start should be non-negative`),ot(t.range.end<=87,`Range end should be within text`),ot(t.range.start<t.range.end,`Range start should be before end`),J(t.value,`Alice Smith`),J(t.polarity,`+`)}}];function Y(e,t){if(!e)throw Error(t||`Assertion failed`)}function ct(e){let t=e.object.datatype?.value||``,n=e.object.language||``;return`${e.subject.value}|${e.predicate.value}|${e.object.value}|${t}|${n}`}function lt(e,t,n,r){return e.some(e=>e.subject.value===t&&e.predicate.value===n&&e.object.value===r)}var ut=[{name:`Primary subjects - single document`,fn:()=>{let e=U([`[my] <tag:hr@example.com,2026:>
|
|
551
551
|
# Employee {=my:emp456 .my:Employee}
|
|
552
|
-
[Alice] {my:name}`]);Y(e.primarySubjects.length===1,`Should have 1 primary subject, got ${e.primarySubjects.length}`),Y(e.primarySubjects[0]===`tag:hr@example.com,2026:emp456`,`Primary subject should be my:emp456, got ${e.primarySubjects[0]}`)}},{name:`Primary subjects - multiple documents`,fn:()=>{let e=U([`[ex] <http://example.org/>
|
|
552
|
+
[Alice] {my:name}`]);Y(e.primarySubjects.length===1,`Should have 1 primary subject, got ${e.primarySubjects.length}`),Y(e.primarySubjects[0]===`tag:hr@example.com,2026:emp456`,`Primary subject should be my:emp456, got ${e.primarySubjects[0]}`),Y(e.primary.length===1,`Should have 1 primary object, got ${e.primary.length}`),Y(e.primary[0].subject===`tag:hr@example.com,2026:emp456`,`Primary object subject should be my:emp456, got ${e.primary[0].subject}`),Y(e.primary[0].type===`tag:hr@example.com,2026:Employee`,`Primary object type should be my:Employee, got ${e.primary[0].type}`),Y(e.primary[0].label===null,`Primary object label should be null, got ${e.primary[0].label}`)}},{name:`Primary subjects - multiple documents`,fn:()=>{let e=U([`[ex] <http://example.org/>
|
|
553
553
|
# Doc1 {=ex:doc1}
|
|
554
554
|
[Value] {label}`,`[ex] <http://example.org/>
|
|
555
555
|
# Doc2 {=ex:doc2}
|
|
@@ -780,568 +780,337 @@ Related to: [Example Project] {+my:example-project ?my:relatedTo .prov:Project l
|
|
|
780
780
|
|
|
781
781
|
# Personal Journal {=j:index .prov:Collection label}
|
|
782
782
|
|
|
783
|
-
|
|
783
|
+
Alice's daily journal, structured as a hierarchy of collections. The top-level index contains [2026] {+j:2026/index ?prov:hadMember label}.
|
|
784
784
|
|
|
785
|
-
|
|
785
|
+
## Year 2026 {=j:2026/index .prov:Collection label}
|
|
786
786
|
|
|
787
|
-
|
|
787
|
+
2026 is organised into monthly collections: [January] {+j:2026/01/index ?prov:hadMember label}, [February] {+j:2026/02/index ?prov:hadMember label}, [March] {+j:2026/03/index ?prov:hadMember label}, [April] {+j:2026/04/index ?prov:hadMember label}, and [May] {+j:2026/05/index ?prov:hadMember label}.
|
|
788
788
|
|
|
789
|
-
|
|
789
|
+
## May 2026 {=j:2026/05/index .prov:Collection label}
|
|
790
790
|
|
|
791
|
-
-
|
|
792
|
-
- February {+j:2026/02/index ?prov:hadMember}
|
|
793
|
-
- March {+j:2026/03/index ?prov:hadMember}
|
|
794
|
-
- April {+j:2026/04/index ?prov:hadMember}
|
|
795
|
-
- May {+j:2026/05/index ?prov:hadMember}
|
|
791
|
+
May started on [2026-05-01] {prov:startedAtTime ^^xsd:date} and is divided into five weekly collections: days [1–3] {+j:2026/05/week-1/index ?prov:hadMember label}, [4–10] {+j:2026/05/week-2/index ?prov:hadMember label}, [11–17] {+j:2026/05/week-3/index ?prov:hadMember label}, [18–24] {+j:2026/05/week-4/index ?prov:hadMember label}, and [25–31] {+j:2026/05/week-5/index ?prov:hadMember label}.
|
|
796
792
|
|
|
797
|
-
## May 2026 {=j:2026/05/index .prov:
|
|
793
|
+
## Week 2, May 2026 {=j:2026/05/week-2/index .prov:Collection label}
|
|
798
794
|
|
|
799
|
-
|
|
795
|
+
The second week of May ran from [2026-05-04] {prov:startedAtTime ^^xsd:date} through [2026-05-10] {prov:endedAtTime ^^xsd:date}. It contained [6] {j:totalActivities ^^xsd:integer} logged activities across [5] {j:readingHours ^^xsd:integer} hours of reading, [8] {j:workHours ^^xsd:integer} hours of work, and [3] {j:exerciseHours ^^xsd:integer} hours of exercise. Of [5] {j:goalsTotal ^^xsd:integer} weekly goals set on Monday, [4] {j:goalsCompleted ^^xsd:integer} were completed and [1] {j:goalsCarryOver ^^xsd:integer} carried over.
|
|
800
796
|
|
|
801
|
-
|
|
797
|
+
The week's daily entries are members of this collection:
|
|
802
798
|
|
|
803
799
|
======
|
|
804
800
|
|
|
805
|
-
|
|
801
|
+
### 06 May 2026 {=j:2026/05/06/index .prov:Activity label}
|
|
806
802
|
|
|
807
|
-
|
|
803
|
+
A productive Wednesday. The day ran from [2026-05-06T08:00:00+04:00] {prov:startedAtTime ^^xsd:dateTime} to [2026-05-06T23:30:00+04:00] {prov:endedAtTime ^^xsd:dateTime} and is a [member] {+j:2026/05/week-2/index ?prov:hadMember} of week 2. It produced a [daily summary] {+j:2026/05/06/summary .prov:Entity ?prov:generated label} capturing mood and locations visited.
|
|
808
804
|
|
|
809
|
-
|
|
805
|
+
The day flowed through three phases, each informing the next: [morning] {+#morning ?prov:wasInformedBy}, then [afternoon] {+#afternoon ?prov:wasInformedBy}, then [social] {+#social ?prov:wasInformedBy}.
|
|
810
806
|
|
|
811
|
-
|
|
812
|
-
Ended: [2026-05-06T23:30:00+04:00] {prov:endedAtTime ^^xsd:dateTime}
|
|
807
|
+
#### Morning {=#morning .prov:Activity label}
|
|
813
808
|
|
|
814
|
-
|
|
809
|
+
The morning started with a [walk] {+#walk ?prov:wasInformedBy} and then [coffee] {+#coffee-prep ?prov:wasInformedBy}.
|
|
815
810
|
|
|
816
|
-
|
|
811
|
+
##### Morning Walk {=#walk .prov:Activity label}
|
|
817
812
|
|
|
818
|
-
|
|
813
|
+
A [45] {j:durationMin ^^xsd:integer}-minute run covering [2.5] {j:distanceMiles ^^xsd:decimal} miles through [Central Park] {+j:place/central-park .prov:Location ?prov:atLocation label}, wearing [running shoes] {+j:shoes/running .prov:Entity ?prov:used label}. The watch generated [heart rate data] {+j:2026/05/06/hr-data .prov:Entity ?prov:generated label} for the session.
|
|
819
814
|
|
|
820
|
-
|
|
821
|
-
- Duration: [45] {j:duration ^^xsd:integer} minutes
|
|
822
|
-
- Distance: [2.5] {j:distance ^^xsd:decimal} miles
|
|
823
|
-
- Location: [Central Park] {+j:place/central-park .prov:Location ?prov:atLocation}
|
|
824
|
-
- Equipment: [Running Shoes] {+j:shoes/running ?prov:used}
|
|
825
|
-
- Generated: [Heart Rate Data] {+j:2026/05/06/hr-data ?prov:generated}
|
|
815
|
+
##### Coffee Preparation {=#coffee-prep .prov:Activity label}
|
|
826
816
|
|
|
827
|
-
|
|
828
|
-
- Location: [Home] {+j:place/home ?prov:atLocation}
|
|
829
|
-
- Resources: [Coffee Beans] {+j:coffee/beans ?prov:used}, [Water] {+j:coffee/water ?prov:used}
|
|
830
|
-
- Generated: [Morning Coffee] {+#morning-coffee ?prov:generated}
|
|
817
|
+
Back [home] {+j:place/home .prov:Location ?prov:atLocation label}, ground [coffee beans] {+j:coffee/beans .prov:Entity ?prov:used label} with [water] {+j:coffee/water .prov:Entity ?prov:used label} and produced a [morning coffee] {+#morning-coffee .prov:Entity ?prov:generated label}.
|
|
831
818
|
|
|
832
|
-
|
|
819
|
+
#### Afternoon {=#afternoon .prov:Activity ?prov:wasInformedBy label}
|
|
833
820
|
|
|
834
|
-
|
|
835
|
-
- Book: [Dune] {+j:dune-book .prov:Entity ?prov:used}
|
|
836
|
-
- Pages: [42] {j:pages ^^xsd:integer}
|
|
837
|
-
- Duration: [2] {j:hours ^^xsd:integer}
|
|
838
|
-
- Generated: [Reading Notes] {+j:reading-notes ?prov:generated}
|
|
821
|
+
The afternoon split between reading and a work session.
|
|
839
822
|
|
|
840
|
-
|
|
841
|
-
- Task: [API Documentation] {+j:api-docs .prov:Entity ?prov:used}
|
|
842
|
-
- Duration: [3] {j:hours ^^xsd:integer}
|
|
843
|
-
- Generated: [Documentation Updates] {+j:doc-updates ?prov:generated}
|
|
823
|
+
##### Reading Session {=#reading .prov:Activity label}
|
|
844
824
|
|
|
845
|
-
|
|
825
|
+
Read [42] {j:pages ^^xsd:integer} pages of [Dune] {+j:dune-book .prov:Entity ?prov:used label} over [2] {j:durationHours ^^xsd:integer} hours, producing [reading notes] {+j:reading-notes .prov:Entity ?prov:generated label}.
|
|
846
826
|
|
|
847
|
-
|
|
848
|
-
- Associated with: [Sam] {+j:sam .prov:Person ?prov:wasAssociatedWith}
|
|
849
|
-
- Location: [Local Cafe] {+j:cafe .prov:Location ?prov:atLocation}
|
|
850
|
-
- Duration: [30] {j:minutes ^^xsd:integer}
|
|
851
|
-
- Topic: [Career Changes] {j:topic}
|
|
827
|
+
##### Work Session {=#work .prov:Activity ?prov:wasInformedBy label}
|
|
852
828
|
|
|
853
|
-
|
|
829
|
+
Spent [3] {j:durationHours ^^xsd:integer} hours on [API documentation] {+j:api-docs .prov:Entity ?prov:used label}, generating [documentation updates] {+j:doc-updates .prov:Entity ?prov:generated label}.
|
|
854
830
|
|
|
855
|
-
|
|
831
|
+
#### Social {=#social .prov:Activity ?prov:wasInformedBy label}
|
|
856
832
|
|
|
857
|
-
|
|
858
|
-
Date: [2026-05-06] {j:date ^^xsd:date}
|
|
859
|
-
Mood: [happy] {j:mood}
|
|
860
|
-
Energy level: [8] {j:energy ^^xsd:integer} out of 10
|
|
861
|
-
Stress level: [2] {j:stress ^^xsd:integer} out of 10
|
|
833
|
+
Met [Sam] {+j:sam .prov:Person ?prov:wasAssociatedWith label} at the [local café] {+j:place/cafe .prov:Location ?prov:atLocation label} for [30] {j:durationMin ^^xsd:integer} minutes to talk through [career changes] {j:topic}.
|
|
862
834
|
|
|
863
|
-
###
|
|
864
|
-
Places visited with frequency and context.
|
|
835
|
+
### Daily Summary {=j:2026/05/06/summary .prov:Entity label}
|
|
865
836
|
|
|
866
|
-
|
|
867
|
-
- [Central Park] {+j:central-park ?j:visited} - [3] {j:visitCount ^^xsd:integer} times this week
|
|
868
|
-
- [Local Cafe] {+j:cafe ?j:visited} - [2] {j:visitCount ^^xsd:integer} times this week
|
|
869
|
-
- [Home Office] {+j:home-office ?j:visited} - [5] {j:visitCount ^^xsd:integer} days this week
|
|
870
|
-
|
|
871
|
-
## Week 2 May 2026 {=j:2026/05/week-2/index .prov:Activity .prov:Collection label}
|
|
872
|
-
|
|
873
|
-
Started: [2026-05-04T00:00:00+04:00] {prov:startedAtTime ^^xsd:dateTime}
|
|
874
|
-
|
|
875
|
-
Aggregated activities and patterns for the week.
|
|
876
|
-
|
|
877
|
-
Started: [2026-05-06T23:00:00Z] {prov:startedAtTime ^^xsd:dateTime}
|
|
878
|
-
Ended: [2026-05-06T23:15:00Z] {prov:endedAtTime ^^xsd:dateTime}
|
|
879
|
-
|
|
880
|
-
### Activities Summary
|
|
881
|
-
Total activities: [6] {j:totalActivities ^^xsd:integer}
|
|
882
|
-
Reading time: [5] {j:readingHours ^^xsd:integer} hours
|
|
883
|
-
Work time: [8] {j:workHours ^^xsd:integer} hours
|
|
884
|
-
Exercise time: [3] {j:exerciseHours ^^xsd:integer} hours
|
|
885
|
-
|
|
886
|
-
### Goals Progress
|
|
887
|
-
Weekly goals: [Set on Monday] {j:weeklyGoals}
|
|
888
|
-
Completed: [4] {j:goalsCompleted ^^xsd:integer} out of 5
|
|
889
|
-
Carry over: [1] {j:goalsCarryOver ^^xsd:integer} goal
|
|
890
|
-
|
|
891
|
-
This demonstrates:
|
|
892
|
-
- Proper PROV-O activity chains
|
|
893
|
-
- Temporal properties with XSD
|
|
894
|
-
- Location and emotional tracking
|
|
895
|
-
- Activity aggregation and summarization
|
|
896
|
-
- Social interaction modeling
|
|
837
|
+
End-of-day reflection, generated by the day's activity. Mood: [happy] {j:mood}, energy [8] {j:energy ^^xsd:integer}/10, stress [2] {j:stress ^^xsd:integer}/10. Places visited today: [Central Park] {+j:place/central-park ?j:visited}, [home] {+j:place/home ?j:visited}, and [local café] {+j:place/cafe ?j:visited}.
|
|
897
838
|
|
|
898
839
|
`,recipe:`[food] <tag:alice@example.com,2026:food/>
|
|
899
840
|
[schema] <http://schema.org/>
|
|
900
841
|
|
|
901
|
-
# Grandma's Apple Pie {=food:apple-pie .schema:Recipe prov:Entity label}
|
|
902
|
-
|
|
903
|
-
Traditional family recipe passed down through generations.
|
|
904
|
-
|
|
905
|
-
Cuisine: [American] {food:cuisine}
|
|
906
|
-
Prep time: [45] {food:prepTime ^^xsd:integer} minutes
|
|
907
|
-
Cook time: [60] {food:cookTime ^^xsd:integer} minutes
|
|
908
|
-
Servings: [8] {food:servings ^^xsd:integer}
|
|
909
|
-
Difficulty: [Medium] {food:difficulty}
|
|
910
|
-
|
|
911
|
-
## Dry Ingredients
|
|
912
|
-
|
|
913
|
-
**Flour** {+food:flour .food:Ingredient ?prov:wasDerivedFrom label}
|
|
914
|
-
**Sugar** {+food:sugar .food:Ingredient ?food:hasIngredient label}
|
|
915
|
-
**Salt** {+food:salt .food:Ingredient ?food:hasIngredient label}
|
|
916
|
-
|
|
917
|
-
### Wet Ingredients
|
|
918
|
-
|
|
919
|
-
**Butter** {+food:butter .food:Ingredient ?food:hasIngredient label}
|
|
920
|
-
**Eggs** {+food:eggs .food:Ingredient ?food:hasIngredient label}
|
|
921
|
-
**Vanilla** {+food:vanilla .food:Ingredient ?food:hasIngredient label}
|
|
922
|
-
|
|
923
|
-
### Filling Ingredients
|
|
842
|
+
# Grandma's Apple Pie {=food:apple-pie .schema:Recipe .prov:Entity label}
|
|
924
843
|
|
|
925
|
-
|
|
926
|
-
**Cinnamon** {+food:cinnamon .food:Ingredient ?food:hasIngredient label}
|
|
927
|
-
**Lemon Juice** {+food:lemon-juice .food:Ingredient ?food:hasIngredient label}
|
|
844
|
+
> Delicious apple pie as gradma used to make it autumn. {comment}
|
|
928
845
|
|
|
929
|
-
|
|
846
|
+
This is a [American] {food:cuisine} family recipe that Grandma Rose has been making since the 1960s. It takes about [45] {food:prepTime ^^xsd:integer} minutes to prepare and [55] {food:cookTime ^^xsd:integer} minutes to bake, making [8] {food:servings ^^xsd:integer} generous slices. It's a variation of [Classic Apple Pie] {+food:classic-apple-pie .schema:Recipe ?schema:isBasedOn label} — her version adds more cinnamon and uses a butter crust rather than shortening. You might also like [Peach Pie] {+food:peach-pie .schema:Recipe ?food:similarRecipe label} or [Apple Crumble] {+food:apple-crumble .schema:Recipe ?food:similarRecipe label} if you want something in the same family.
|
|
930
847
|
|
|
931
|
-
|
|
848
|
+
Per serving this comes in at around [320] {food:calories ^^xsd:integer} calories, [14g] {food:fat} fat, [42g] {food:carbs} carbs, and [2g] {food:protein} protein.
|
|
932
849
|
|
|
933
|
-
|
|
850
|
+
## Ingredients
|
|
934
851
|
|
|
935
|
-
###
|
|
852
|
+
### Crust
|
|
936
853
|
|
|
937
|
-
|
|
854
|
+
**Flour** {=food:flour}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *includes* {=#flour ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [2.5] {food:amount ^^xsd:decimal} [cups] {+food:cup ?food:unit} of *flour* {+food:flour ?prov:entity}.
|
|
938
855
|
|
|
939
|
-
|
|
856
|
+
**Butter** {=food:butter}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *includes* {=#butter ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [1] {food:amount ^^xsd:decimal} [cup] {+food:cup ?food:unit} of *cold* {food:temperature} *butter* {+food:butter ?prov:entity}.
|
|
940
857
|
|
|
941
|
-
|
|
858
|
+
**Eggs** {=food:salt}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is made with* {=#eggs ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [2] {food:amount ^^xsd:integer} *eggs* {+food:egg ?prov:entity}.
|
|
942
859
|
|
|
943
|
-
|
|
860
|
+
**Sugar** {=food:sugar}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is made with* {=#sugar ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [1] {food:amount ^^xsd:decimal} [cup] {+food:cup ?food:unit} of *butter* {+food:sugar ?prov:entity}.
|
|
944
861
|
|
|
945
|
-
|
|
862
|
+
**Salt** {=food:salt}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is made with* {=#salt ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [0.5] {food:amount ^^xsd:decimal} [tsp] {+food:tsp ?food:unit} of *salt* {+food:salt ?prov:entity}.
|
|
946
863
|
|
|
947
|
-
|
|
864
|
+
**Vanilla** {=food:vanilla}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is made with* {=#vanilla ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [1] {food:amount ^^xsd:decimal} [tsp] {+food:tsp ?food:unit} of *vanilla* {+food:vanilla ?prov:entity}.
|
|
948
865
|
|
|
949
|
-
###
|
|
866
|
+
### Filling
|
|
950
867
|
|
|
951
|
-
|
|
868
|
+
**Apples** {=food:apples}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *includes* {=#apples ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [6] {food:amount ^^xsd:integer} medium *apples* {+food:apple ?prov:entity}, peeled and sliced.
|
|
952
869
|
|
|
953
|
-
|
|
870
|
+
**Cinnamon** {=food:cinnamon}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is seasoned with* {=#cinnamon ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [2] {food:amount ^^xsd:integer} [tsp] {+food:tsp ?food:unit} ground *cinnamon* {+food:cinnamon ?prov:entity}.
|
|
954
871
|
|
|
955
|
-
|
|
872
|
+
**Lemon Juice** {=food:lemon-juice}: [Pie] {=food:apple-pie !prov:wasDerivedFrom} *is seasoned with* {=#lemon-juice ?prov:qualifiedDerivation .prov:Derivation .prov:Usage} [1] {food:amount ^^xsd:integer} [tbsp] {+food:tbsp ?food:unit} *lemon juice* {+food:lemon-juice ?prov:entity}.
|
|
956
873
|
|
|
957
|
-
|
|
958
|
-
- Calories: [320] {food:calories ^^xsd:integer}
|
|
959
|
-
- Fat: [14g] {food:fat ^^xsd:string}
|
|
960
|
-
- Carbohydrates: [42g] {food:carbs ^^xsd:string}
|
|
961
|
-
- Protein: [2g] {food:protein ^^xsd:string}
|
|
874
|
+
## Making the Crust {=#step-crust .prov:Activity label}
|
|
962
875
|
|
|
963
|
-
|
|
876
|
+
Mix [flour] {+#flour ?prov:qualifiedUsage}, [sugar] {+#sugar ?prov:qualifiedUsage}, and [salt] {+#salt ?prov:qualifiedUsage} together, then cut in [cold butter] {+#butter ?prov:qualifiedUsage} until the mixture looks like coarse crumbs. Press into your [pie dish] {+food:pie-dish .food:Equipment ?prov:used label} and set aside. This produces the [unbaked crust] {+#unbaked-crust .prov:Entity ?prov:generated label}.
|
|
964
877
|
|
|
965
|
-
|
|
878
|
+
## Making the Filling {=#step-filling .prov:Activity ?prov:wasInformedBy label}
|
|
966
879
|
|
|
967
|
-
|
|
968
|
-
Documented by: [Alice] {+food:alice .prov:Person ?prov:wasAssociatedWith}
|
|
969
|
-
Date: [2026-05-06] {prov:startedAtTime ^^xsd:date}
|
|
970
|
-
Used: [Family Recipe Book] {+food:recipe-book ?prov:used}
|
|
880
|
+
Toss [apples] {+#apples ?prov:qualifiedUsage} with [cinnamon] {+#cinnamon ?prov:qualifiedUsage} and [lemon juice] {+#lemon-juice ?prov:qualifiedUsage}. Let it sit for [10] {food:restTime ^^xsd:integer} minutes so the flavours start to meld — you'll see some juice pool at the bottom, that's what makes it bubbly in the oven. This gives you the [spiced filling] {+#spiced-filling .prov:Entity ?prov:generated label}.
|
|
971
881
|
|
|
972
|
-
|
|
882
|
+
## Assembly and Baking {=#step-baking .prov:Activity ?prov:wasInformedBy label}
|
|
973
883
|
|
|
974
|
-
This
|
|
975
|
-
- Schema.org Recipe vocabulary
|
|
976
|
-
- Complex ingredient relationships
|
|
977
|
-
- Multi-step process with provenance
|
|
978
|
-
- Nutritional information
|
|
979
|
-
- Recipe variations and relationships
|
|
884
|
+
Spoon the [spiced filling] {+#spiced-filling ?prov:used} into the [unbaked crust] {+#unbaked-crust ?prov:used}, cover with a [top crust] {+#top-crust ?prov:used label}, and cut a few vent holes so steam can escape. Bake at [375] {food:bakeTempF ^^xsd:integer}°F for [50] {food:bakeTimeMin ^^xsd:integer} minutes until [golden brown] {food:color}. This produces the [finished pie] {+#finished-pie .prov:Entity ?prov:generated label}.
|
|
980
885
|
|
|
886
|
+
## How This Recipe Came to Be {=#creation .prov:Activity ?prov:wasInformedBy label}
|
|
981
887
|
|
|
888
|
+
[Grandma Rose] {+food:grandma-rose .prov:Person ?prov:wasAssociatedWith label} developed this version over many years, working from the [Family Recipe Book] {+food:recipe-book .prov:Entity ?prov:used label} she brought from her childhood home. [Alice] {+food:alice .prov:Person ?prov:wasAssociatedWith label} wrote it down on [2026-05-06] {prov:endedAtTime ^^xsd:date} to make sure it wouldn't be lost, producing this [recipe documentation] {+#recipe-docs .prov:Entity ?prov:generated label}.`,project:`[proj] <tag:alice@example.com,2026:project/>
|
|
982
889
|
|
|
983
|
-
|
|
984
|
-
- [1] {food:amount ^^xsd:decimal} cup
|
|
985
|
-
- [0.5] {food:amount ^^xsd:decimal} tsp
|
|
986
|
-
- [1] {food:amount ^^xsd:decimal} cup, cold
|
|
987
|
-
- [2] {food:amount ^^xsd:integer} large
|
|
988
|
-
- [1] {food:amount ^^xsd:decimal} tsp
|
|
890
|
+
# Website Redesign {=proj:website .proj:Project .prov:Plan label}
|
|
989
891
|
|
|
990
|
-
|
|
991
|
-
- [2] {food:amount ^^xsd:integer} tsp ground
|
|
992
|
-
- [1] {food:amount ^^xsd:integer} tbsp`,project:`[proj] <tag:alice@example.com,2026:project/>
|
|
892
|
+
The Q2 2026 website redesign is a [$25,000] {proj:budget ^^xsd:decimal} initiative running from [2026-06-01] {prov:startedAtTime ^^xsd:date} through [2026-08-31] {prov:endedAtTime ^^xsd:date}, currently in [planning] {proj:status} status. It is backed by the [Marketing Department] {+proj:marketing ?proj:sponsor .prov:Organization label} and [Customer Support] {+proj:support ?proj:stakeholder .prov:Organization label}, both of whom provided the brief.
|
|
993
893
|
|
|
994
|
-
|
|
894
|
+
## Team
|
|
995
895
|
|
|
996
|
-
|
|
896
|
+
Three people assembled under the [Q2 Website Plan] {+proj:q2-plan .prov:Plan label} to staff this project.
|
|
997
897
|
|
|
998
|
-
|
|
898
|
+
### Alice Johnson {=proj:alice .prov:Person label}
|
|
999
899
|
|
|
1000
|
-
|
|
1001
|
-
Start date: [2026-06-01] {proj:startDate ^^xsd:date}
|
|
1002
|
-
End date: [2026-08-31] {proj:endDate ^^xsd:date}
|
|
1003
|
-
Status: [planning] {proj:status}
|
|
900
|
+
[alice@example.com] {proj:email} — [Project Manager] {proj:role}, responsible for overall delivery and stakeholder communication.
|
|
1004
901
|
|
|
1005
|
-
|
|
902
|
+
### Bob Smith {=proj:bob .prov:Person label}
|
|
1006
903
|
|
|
1007
|
-
|
|
1008
|
-
Associated with: [Alice Johnson] {+proj:alice .prov:Person ?prov:wasAssociatedWith} as Project Manager
|
|
1009
|
-
Plan: [Q2 Website Plan] {+proj:q2-plan .prov:Plan ?prov:hadPlan}
|
|
904
|
+
[bob@example.com] {proj:email} — [Lead Developer] {proj:role}, leading all frontend and backend implementation work. Bob acts on behalf of [Alice] {+proj:alice ?prov:actedOnBehalfOf} as the technical authority for the project.
|
|
1010
905
|
|
|
1011
|
-
|
|
906
|
+
### Carol Davis {=proj:carol .prov:Person label}
|
|
1012
907
|
|
|
1013
|
-
|
|
908
|
+
[carol@example.com] {proj:email} — [UX Designer] {proj:role}, responsible for user research through to final visual design.
|
|
1014
909
|
|
|
1015
|
-
|
|
910
|
+
## Team Formation {=proj:team-formation .prov:Activity label}
|
|
1016
911
|
|
|
1017
|
-
|
|
1018
|
-
Email: [alice@example.com] {proj:email}
|
|
1019
|
-
Role: [Project Manager] {proj:role}
|
|
912
|
+
On [2026-05-15T09:00:00Z] {prov:startedAtTime ^^xsd:dateTime} Alice convened the team and formalised the plan. She was [associated with] {+proj:alice ?prov:wasAssociatedWith} the activity directly, and it produced the [assembled team entity] {+proj:team-structure .prov:Entity ?prov:generated label} — the agreed roster and responsibility assignments that subsequent phases depend on.
|
|
1020
913
|
|
|
1021
|
-
|
|
914
|
+
## Design Phase {=proj:design-phase .prov:Activity ?prov:wasInformedBy label}
|
|
1022
915
|
|
|
1023
|
-
|
|
1024
|
-
Email: [bob@example.com] {proj:email}
|
|
1025
|
-
Role: [Lead Developer] {proj:role}
|
|
916
|
+
Kicking off on [2026-06-01] {prov:startedAtTime ^^xsd:date} and wrapping by [2026-06-15] {prov:endedAtTime ^^xsd:date}, the design phase was led by [Carol] {+proj:carol ?prov:wasAssociatedWith}. It drew on the [assembled team entity] {+proj:team-structure ?prov:used} established during team formation and consumed the [existing design system] {+proj:design-system .prov:Entity ?prov:used label} as a constraint baseline. The phase moved from user interviews through wireframes to polished mockups, producing the [design documentation] {+proj:design-docs .prov:Entity ?prov:generated label} that development would build from.
|
|
1026
917
|
|
|
1027
|
-
|
|
918
|
+
## Development Phase {=proj:dev-phase .prov:Activity ?prov:wasInformedBy label}
|
|
1028
919
|
|
|
1029
|
-
|
|
1030
|
-
Email: [carol@example.com] {proj:email}
|
|
1031
|
-
Role: [UX Designer] {proj:role}
|
|
920
|
+
Development ran from [2026-06-16] {prov:startedAtTime ^^xsd:date} to [2026-07-30] {prov:endedAtTime ^^xsd:date}, led by [Bob] {+proj:bob ?prov:wasAssociatedWith}. The team used the [design documentation] {+proj:design-docs ?prov:used} directly — no redesign, just implementation — alongside the [API documentation] {+proj:api-docs .prov:Entity ?prov:used label} for backend contracts. The phase generated the [working prototype] {+proj:prototype .prov:Entity ?prov:generated label} deployed to staging.
|
|
1032
921
|
|
|
1033
|
-
##
|
|
922
|
+
## Validation Shapes
|
|
1034
923
|
|
|
1035
|
-
|
|
924
|
+
Every project document should be self-consistent. These shapes enforce the minimum structural expectations for a project, its team, and its deliverables.
|
|
1036
925
|
|
|
1037
|
-
|
|
1038
|
-
Ended: [2026-06-15] {prov:endedAtTime ^^xsd:date}
|
|
926
|
+
### Project Shape {=proj:ProjectShape .sh:NodeShape label}
|
|
1039
927
|
|
|
1040
|
-
|
|
1041
|
-
- [User Research] {+proj:user-research .proj:Task ?prov:used} - interviews and surveys
|
|
1042
|
-
- [Wireframes] {+proj:wireframes .proj:Task ?prov:used} - low-fidelity layouts
|
|
1043
|
-
- [High-fidelity Mockups] {+proj:mockups .proj:Task ?prov:used} - detailed designs
|
|
928
|
+
Validates every [proj:Project] {+proj:Project ?sh:targetClass} to carry a [budget] {+#budget ?sh:property sh:name}, a [status] {+#status ?sh:property sh:name}, and at least one [sponsor] {+#sponsor ?sh:property sh:name}.
|
|
1044
929
|
|
|
1045
|
-
|
|
930
|
+
#### Budget is required {=#budget .sh:PropertyShape sh:message}
|
|
931
|
+
[proj:budget] {+proj:budget ?sh:path} must appear exactly [1] {sh:minCount sh:maxCount ^^xsd:integer} time and be a [decimal] {+xsd:decimal ?sh:datatype}.
|
|
1046
932
|
|
|
1047
|
-
|
|
933
|
+
#### Status is required {=#status .sh:PropertyShape sh:message}
|
|
934
|
+
[proj:status] {+proj:status ?sh:path} must appear at least [1] {sh:minCount ^^xsd:integer} time.
|
|
1048
935
|
|
|
1049
|
-
|
|
1050
|
-
|
|
936
|
+
#### Sponsor is required {=#sponsor .sh:PropertyShape sh:message}
|
|
937
|
+
A project must be backed by at least [1] {sh:minCount ^^xsd:integer} [proj:sponsor] {+proj:sponsor ?sh:path}.
|
|
1051
938
|
|
|
1052
|
-
|
|
1053
|
-
- [Frontend Development] {+proj:frontend .proj:Task ?prov:used} - React components
|
|
1054
|
-
- [Backend API] {+proj:backend .proj:Task ?prov:used} - Node.js services
|
|
1055
|
-
- [Database Schema] {+proj:database .proj:Task ?prov:used} - PostgreSQL design
|
|
939
|
+
### Team Member Shape {=proj:PersonShape .sh:NodeShape label}
|
|
1056
940
|
|
|
1057
|
-
|
|
941
|
+
Validates every [prov:Person] {+prov:Person ?sh:targetClass} in this project to have an [email] {+#email ?sh:property sh:name} and a [role] {+#role ?sh:property sh:name}.
|
|
1058
942
|
|
|
1059
|
-
|
|
943
|
+
#### Email is required {=#email .sh:PropertyShape sh:message}
|
|
944
|
+
[proj:email] {+proj:email ?sh:path} must appear exactly [1] {sh:minCount sh:maxCount ^^xsd:integer} time and match the pattern [^.+@.+$] {sh:pattern}.
|
|
1060
945
|
|
|
1061
|
-
|
|
946
|
+
#### Role is required {=#role .sh:PropertyShape sh:message}
|
|
947
|
+
[proj:role] {+proj:role ?sh:path} must appear at least [1] {sh:minCount ^^xsd:integer} time.
|
|
1062
948
|
|
|
1063
|
-
|
|
1064
|
-
- [Design System] {+proj:design-system ?proj:requires}
|
|
1065
|
-
- [API Documentation] {+proj:api-docs ?proj:requires}
|
|
949
|
+
### Deliverable Shape {=proj:DeliverableShape .sh:NodeShape label}
|
|
1066
950
|
|
|
1067
|
-
|
|
951
|
+
Validates every [prov:Entity] {+prov:Entity ?sh:targetClass} produced by a project activity to have a [label] {+#dlabel ?sh:property sh:name} and a [wasGeneratedBy] {+#generated ?sh:property sh:name} link.
|
|
1068
952
|
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
- [Customer Support] {+proj:support ?proj:stakeholder .prov:Organization}
|
|
953
|
+
#### Label is required {=#dlabel .sh:PropertyShape sh:message}
|
|
954
|
+
Every deliverable must have exactly [1] {sh:minCount sh:maxCount ^^xsd:integer} [rdfs:label] {+rdfs:label ?sh:path}.
|
|
1072
955
|
|
|
1073
|
-
|
|
956
|
+
#### Generation link is required {=#generated .sh:PropertyShape sh:message}
|
|
957
|
+
Every deliverable must trace back to at least [1] {sh:minCount ^^xsd:integer} [prov:wasGeneratedBy] {+prov:wasGeneratedBy ?sh:path} activity.
|
|
1074
958
|
|
|
1075
|
-
|
|
959
|
+
## Project Is On Schedule {=proj:stmt-schedule .rdf:Statement .prov:Entity label}
|
|
1076
960
|
|
|
1077
|
-
|
|
961
|
+
**The working prototype** {+proj:prototype ?rdf:subject} *was delivered by* {+proj:deliveredBy ?rdf:predicate} **2026-07-30, within the original timeline** {+proj:original-timeline ?rdf:object}.
|
|
962
|
+
Generated by: [Development Phase] {+proj:dev-phase ?prov:wasGeneratedBy}
|
|
963
|
+
Derived from: [Design Documentation] {+proj:design-docs ?prov:wasDerivedFrom}
|
|
964
|
+
Established: [2026-07-30T00:00:00Z] {prov:generatedAtTime ^^xsd:dateTime}
|
|
1078
965
|
|
|
1079
|
-
|
|
1080
|
-
Responsible: [Frontend Team] {+proj:frontend-team .prov:Organization ?prov:responsible}
|
|
1081
|
-
Activity: [Frontend Development] {+proj:frontend-dev .prov:Activity ?prov:hadActivity}
|
|
1082
|
-
Role: [Development Lead] {+proj:dev-lead .prov:Role ?prov:hadRole}
|
|
966
|
+
## Design System Adopted as Foundation {=proj:stmt-design-system .rdf:Statement .prov:Entity label}
|
|
1083
967
|
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
-
|
|
1088
|
-
-
|
|
1089
|
-
- Cross-ontology integration
|
|
1090
|
-
`,"space-mission":`[prov] <http://www.w3.org/ns/prov#>
|
|
1091
|
-
[nasa] <http://nasa.gov/>
|
|
968
|
+
**The design documentation** {+proj:design-docs ?rdf:subject} *was derived from* {+prov:wasDerivedFrom ?rdf:predicate} **the existing design system** {+proj:design-system ?rdf:object}.
|
|
969
|
+
Generated by: [Design Phase] {+proj:design-phase ?prov:wasGeneratedBy}
|
|
970
|
+
Derived from: [Team Formation] {+proj:team-formation ?prov:wasDerivedFrom}
|
|
971
|
+
Established: [2026-06-15T00:00:00Z] {prov:generatedAtTime ^^xsd:dateTime}
|
|
972
|
+
`,"space-mission":`[cassini] <https://nasa.gov/cassini/>
|
|
1092
973
|
[xsd] <http://www.w3.org/2001/XMLSchema#>
|
|
1093
974
|
|
|
1094
|
-
#
|
|
975
|
+
# Cassini-Huygens Mission {=cassini:mission .prov:Activity label}
|
|
1095
976
|
|
|
1096
|
-
|
|
977
|
+
> Cassini-Huygens was a joint NASA/ESA/ASI mission to Saturn, running from launch in 1997 to a deliberate atmospheric entry in 2017. {comment}
|
|
1097
978
|
|
|
1098
|
-
|
|
979
|
+
Over nearly two decades it reshaped our understanding of the ringed planet, its moons, and the potential for life in the outer solar system. This document traces the mission's major phases as a provenance chain, with the spacecraft's modules modelled as the agents responsible for each phase of science.
|
|
1099
980
|
|
|
1100
|
-
|
|
1101
|
-
Landing date: [1969-07-20] {nasa:landingDate ^^xsd:date}
|
|
1102
|
-
Mission duration: [8] {nasa:durationDays ^^xsd:integer} days
|
|
1103
|
-
Budget: [$2.5] {nasa:budget ^^xsd:decimal} billion USD
|
|
1104
|
-
Status: [Success] {nasa:missionStatus}
|
|
981
|
+
## Spacecraft Modules {=cassini:spacecraft .prov:Entity label}
|
|
1105
982
|
|
|
1106
|
-
|
|
983
|
+
The spacecraft comprised two largely independent systems that separated after arrival at Saturn.
|
|
1107
984
|
|
|
1108
|
-
|
|
985
|
+
### Cassini Orbiter {=cassini:orbiter .prov:Agent label}
|
|
1109
986
|
|
|
1110
|
-
|
|
1111
|
-
Started: [1969-07-16T13:32:00Z] {prov:startedAtTime ^^xsd:dateTime}
|
|
1112
|
-
Ended: [1969-07-16T13:35:00Z] {prov:endedAtTime ^^xsd:dateTime}
|
|
1113
|
-
Associated with: [Launch Team] {+nasa:launch-team ?prov:wasAssociatedWith .prov:Organization}
|
|
1114
|
-
Used: [Saturn V Rocket] {+nasa:saturnv .nasa:Rocket ?prov:used}
|
|
1115
|
-
Generated: [Earth Orbit] {+nasa:earth-orbit ?prov:generated}
|
|
987
|
+
Built by NASA's Jet Propulsion Laboratory, it spent thirteen years in Saturn orbit carrying twelve science instruments. Its mass was [2,523] {cassini:massKg ^^xsd:decimal} kg at launch and it was operated by [JPL] {+cassini:jpl ?prov:actedOnBehalfOf .prov:Organization label}.
|
|
1116
988
|
|
|
1117
|
-
###
|
|
1118
|
-
Started: [1969-07-16T13:35:00Z] {prov:startedAtTime ^^xsd:dateTime}
|
|
1119
|
-
Ended: [1969-07-16T16:00:00Z] {prov:endedAtTime ^^xsd:dateTime}
|
|
1120
|
-
Informed by: [Launch Phase] {+nasa:launch ?prov:wasInformedBy}
|
|
1121
|
-
Used: [Saturn V S-IVB Stage] {+nasa:saturnv-stage ?prov:used}
|
|
1122
|
-
Generated: [Lunar Trajectory] {+nasa:lunar-trajectory ?prov:generated}
|
|
989
|
+
### Huygens Probe {=cassini:huygens .prov:Agent label}
|
|
1123
990
|
|
|
1124
|
-
|
|
1125
|
-
Started: [1969-07-20T20:05:00Z] {prov:startedAtTime ^^xsd:dateTime}
|
|
1126
|
-
Ended: [1969-07-20T20:17:00Z] {prov:endedAtTime ^^xsd:dateTime}
|
|
1127
|
-
Informed by: [Trans-Lunar Injection] {+nasa:tli ?prov:wasInformedBy}
|
|
1128
|
-
Used: [LM Eagle] {+nasa:eagle .nasa:Module ?prov:used}
|
|
1129
|
-
Generated: [Lunar Surface Presence] {+nasa:lunar-presence ?prov:generated}
|
|
991
|
+
An ESA-built atmospheric entry vehicle designed for a single-use descent through Titan's thick nitrogen atmosphere. It carried [six] {cassini:instrumentCount ^^xsd:integer} dedicated instruments and acted on behalf of [ESA] {+cassini:esa ?prov:actedOnBehalfOf .prov:Organization label}.
|
|
1130
992
|
|
|
1131
|
-
##
|
|
993
|
+
## Mission Timeline
|
|
1132
994
|
|
|
1133
|
-
|
|
995
|
+
The mission unfolded in four major phases, each building on the last through a clean provenance chain.
|
|
1134
996
|
|
|
1135
|
-
###
|
|
1136
|
-
Name: [Neil Armstrong] {rdfs:label}
|
|
1137
|
-
Born: [1930-08-05] {nasa:birthDate ^^xsd:date}
|
|
1138
|
-
Role: [Commander] {nasa:missionRole}
|
|
1139
|
-
First step: [First human on Moon] {nasa:achievement}
|
|
997
|
+
### Launch and Cruise {=cassini:launch-cruise .prov:Activity label}
|
|
1140
998
|
|
|
1141
|
-
|
|
1142
|
-
Name: [Buzz Aldrin] {rdfs:label}
|
|
1143
|
-
Born: [1930-01-20] {nasa:birthDate ^^xsd:date}
|
|
1144
|
-
Role: [Lunar Module Pilot] {nasa:missionRole}
|
|
1145
|
-
EVA duration: [2h 18m] {nasa:evaDuration ^^xsd:string}
|
|
999
|
+
Cassini lifted off on [1997-10-15T08:43:00Z] {prov:startedAtTime ^^xsd:dateTime} and spent seven years on a gravity-assist trajectory through the inner solar system. The [Cassini orbiter] {+cassini:orbiter ?prov:wasAssociatedWith} and [Huygens probe] {+cassini:huygens ?prov:wasAssociatedWith} traveled together. The cruise ended on [2004-07-01T02:12:00Z] {prov:endedAtTime ^^xsd:dateTime} when the main engine fired for Saturn Orbit Insertion, producing the [Saturn approach dataset] {+cassini:cruise-data .prov:Entity ?prov:generated label} — dust measurements, solar wind readings, and the first distant imaging of the Saturn system.
|
|
1146
1000
|
|
|
1147
|
-
###
|
|
1148
|
-
Name: [Michael Collins] {rdfs:label}
|
|
1149
|
-
Born: [1930-10-31] {nasa:birthDate ^^xsd:date}
|
|
1150
|
-
Role: [Command Module Pilot] {nasa:missionRole}
|
|
1151
|
-
Responsibility: [Orbital operations] {nasa:responsibility}
|
|
1001
|
+
### Saturn Orbit Insertion {=cassini:soi .prov:Activity ?prov:wasInformedBy label}
|
|
1152
1002
|
|
|
1153
|
-
|
|
1003
|
+
The engine burn on [2004-07-01T02:12:00Z] {prov:startedAtTime ^^xsd:dateTime} lasting 96 minutes placed Cassini into Saturn orbit. It ended at [2004-07-01T03:48:00Z] {prov:endedAtTime ^^xsd:dateTime}. The [Cassini orbiter] {+cassini:orbiter ?prov:wasAssociatedWith} executed the manoeuvre autonomously. This generated the [initial ring-crossing observations] {+cassini:ring-crossing-data .prov:Entity ?prov:generated label} — the first in-situ measurements of ring particle composition.
|
|
1154
1004
|
|
|
1155
|
-
|
|
1005
|
+
### Huygens Titan Descent {=cassini:titan-descent .prov:Activity ?prov:wasInformedBy label}
|
|
1156
1006
|
|
|
1157
|
-
|
|
1158
|
-
Name: [Saturn V] {rdfs:label}
|
|
1159
|
-
Manufacturer: [Boeing] {nasa:manufacturer}
|
|
1160
|
-
Height: [363] {nasa:height ^^xsd:integer} ft
|
|
1161
|
-
Thrust: [7.6] {nasa:thrust ^^xsd:decimal} million lbs
|
|
1007
|
+
The Huygens probe was released on [2004-12-25] {prov:startedAtTime ^^xsd:date} and entered Titan's atmosphere on [2005-01-14T09:10:00Z] {prov:endedAtTime ^^xsd:dateTime}. The [Huygens probe] {+cassini:huygens ?prov:wasAssociatedWith} descended for 72 minutes through hydrocarbon haze, producing the [Titan atmosphere profile] {+cassini:titan-atmos-data .prov:Entity ?prov:generated label} — temperature, pressure, and wind measurements from 1,270 km altitude down to the surface, along with the first images of Titan's surface from inside the atmosphere.
|
|
1162
1008
|
|
|
1163
|
-
###
|
|
1164
|
-
Name: [Eagle] {rdfs:label}
|
|
1165
|
-
Manufacturer: [Grumman Aircraft] {nasa:manufacturer}
|
|
1166
|
-
Mass: [15,897] {nasa:mass ^^xsd:decimal} lb
|
|
1167
|
-
Crew capacity: [2] {nasa:crewCapacity ^^xsd:integer}
|
|
1009
|
+
### Extended Orbital Science {=cassini:orbital-science .prov:Activity ?prov:wasInformedBy label}
|
|
1168
1010
|
|
|
1169
|
-
|
|
1170
|
-
Name: [Columbia] {rdfs:label}
|
|
1171
|
-
Manufacturer: [North American Aviation] {nasa:manufacturer}
|
|
1172
|
-
Mass: [28,801] {nasa:mass ^^xsd:decimal} lb
|
|
1173
|
-
Crew capacity: [3] {nasa:crewCapacity ^^xsd:integer}
|
|
1011
|
+
The Cassini orbiter conducted [294] {cassini:titanFlybys ^^xsd:integer} Titan flybys and numerous close encounters with Enceladus, Iapetus, and Rhea from [2004-07-01] {prov:startedAtTime ^^xsd:date} through [2017-09-15] {prov:endedAtTime ^^xsd:date}. The [Cassini orbiter] {+cassini:orbiter ?prov:wasAssociatedWith} generated the [Enceladus plume dataset] {+cassini:enceladus-data .prov:Entity ?prov:generated label} during six dedicated low-altitude passes through the southern polar geysers.
|
|
1174
1012
|
|
|
1175
|
-
##
|
|
1013
|
+
## Key Findings
|
|
1176
1014
|
|
|
1177
|
-
|
|
1015
|
+
Two results stood out above all others and are elevated here as the mission's golden graph — the facts everything else builds toward.
|
|
1178
1016
|
|
|
1179
|
-
|
|
1180
|
-
Description: [Land humans on Moon and return safely] {rdfs:label}
|
|
1181
|
-
Status: [Achieved] {nasa:achievementStatus}
|
|
1182
|
-
Achievement date: [1969-07-20] {nasa:achievementDate ^^xsd:date}
|
|
1017
|
+
## Enceladus Hosts a Subsurface Ocean {=cassini:stmt-ocean .rdf:Statement .prov:Entity label}
|
|
1183
1018
|
|
|
1184
|
-
|
|
1019
|
+
**The Enceladus plume dataset** {+cassini:enceladus-data ?rdf:subject} *confirmed* {+cassini:hasSubsurfaceOcean ?rdf:predicate} **a global liquid water ocean beneath its ice shell** {+cassini:enceladus-ocean ?rdf:object}.
|
|
1020
|
+
Generated by: [Extended Orbital Science] {+cassini:orbital-science ?prov:wasGeneratedBy}
|
|
1021
|
+
Derived from: [Saturn Orbit Insertion] {+cassini:soi ?prov:wasDerivedFrom}
|
|
1022
|
+
Established: [2014-04-03T00:00:00Z] {prov:generatedAtTime ^^xsd:dateTime}
|
|
1185
1023
|
|
|
1186
|
-
|
|
1187
|
-
Description: [Collect lunar samples for scientific analysis] {rdfs:label}
|
|
1188
|
-
Status: [Achieved] {nasa:achievementStatus}
|
|
1189
|
-
Sample weight: [21.5] {nasa:sampleWeight ^^xsd:decimal} kg
|
|
1024
|
+
## Titan Has a Methane Hydrological Cycle {=cassini:stmt-methane .rdf:Statement .prov:Entity label}
|
|
1190
1025
|
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
## Mission Control {=nasa:mission-control .prov:Organization label}
|
|
1197
|
-
|
|
1198
|
-
Ground support team with delegation structure.
|
|
1199
|
-
|
|
1200
|
-
### Flight Directors {=nasa:flight-directors .prov:Organization label}
|
|
1201
|
-
Role: [Mission supervision] {nasa:role}
|
|
1202
|
-
Personnel: [Gene Kranz, Glynn Lunney, Gerald Griffin] {nasa:personnel}
|
|
1203
|
-
|
|
1204
|
-
### Delegation Pattern {=nasa:operation-delegation .prov:Delegation ?prov:qualifiedDelegation}
|
|
1205
|
-
|
|
1206
|
-
NASA Administrator delegates operational authority to Mission Control.
|
|
1207
|
-
|
|
1208
|
-
Delegator: [NASA Administrator] {+nasa:admin ?prov:delegate}
|
|
1209
|
-
Responsible: [Mission Control] {+nasa:mission-control ?prov:responsible}
|
|
1210
|
-
Activity: [Flight Operations] {+nasa:flight-ops ?prov:hadActivity}
|
|
1211
|
-
Role: [Flight Director] {+nasa:flight-director ?prov:hadRole}
|
|
1212
|
-
|
|
1213
|
-
This demonstrates:
|
|
1214
|
-
- Complete PROV-O activity chains
|
|
1215
|
-
- Proper temporal properties with XSD
|
|
1216
|
-
- Organizational structure and delegation
|
|
1217
|
-
- Equipment tracking and relationships
|
|
1218
|
-
- Goal achievement modeling
|
|
1026
|
+
**The Titan atmosphere profile** {+cassini:titan-atmos-data ?rdf:subject} *revealed* {+cassini:hasMethaneHydrologicalCycle ?rdf:predicate} **a full methane rain-lake-evaporation cycle on Titan's surface** {+cassini:titan-methane-cycle ?rdf:object}.
|
|
1027
|
+
Generated by: [Huygens Titan Descent] {+cassini:titan-descent ?prov:wasGeneratedBy}
|
|
1028
|
+
Derived from: [Saturn Orbit Insertion] {+cassini:soi ?prov:wasDerivedFrom}
|
|
1029
|
+
Established: [2005-01-14T00:00:00Z] {prov:generatedAtTime ^^xsd:dateTime}
|
|
1219
1030
|
`,research:`[research] <https://research.example.org/>
|
|
1220
1031
|
[data] <https://research.example.org/datasets/>
|
|
1221
|
-
[prov] <http://www.w3.org/ns/prov#>
|
|
1222
|
-
[sh] <http://www.w3.org/ns/shacl#>
|
|
1223
|
-
[xsd] <http://www.w3.org/2001/XMLSchema#>
|
|
1224
1032
|
|
|
1225
1033
|
# Medical Imaging AI Research {=research:paper .prov:Entity label}
|
|
1226
1034
|
|
|
1227
|
-
|
|
1035
|
+
This paper explores how deep learning attention mechanisms can improve automated diagnosis from medical imaging data, covering the full arc from dataset assembly through model training to peer-reviewed publication.
|
|
1228
1036
|
|
|
1229
1037
|
## Authors {=research:authors .prov:Entity label}
|
|
1230
1038
|
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
### Primary Author {=research:sarah-martinez .prov:Person label}
|
|
1234
|
-
Name: [Dr. Sarah Martinez] {rdfs:label}
|
|
1235
|
-
Email: [sarah.martinez@mit.edu] {research:email}
|
|
1236
|
-
Role: [Lead Researcher] {research:role}
|
|
1237
|
-
Contribution: [Methodology development] {research:contribution}
|
|
1238
|
-
|
|
1239
|
-
### Co-Author {=research:james-liu .prov:Person label}
|
|
1240
|
-
Name: [Dr. James Liu] {rdfs:label}
|
|
1241
|
-
Email: [james.liu@mit.edu] {research:email}
|
|
1242
|
-
Role: [ML Engineer] {research:role}
|
|
1243
|
-
Contribution: [Model implementation] {research:contribution}
|
|
1039
|
+
The work was led by **[Dr. Sarah Martinez](mailto:sarah.martinez@mit.edu)** {rdfs:label} {research:email} at MIT, who served as [Lead Researcher] {research:role} and was responsible for [methodology development] {research:contribution}. Joining her was **[Dr. James Liu](mailto:james.liu@mit.edu)** {=research:james-liu .prov:Person rdfs:label research:email}, the team's [ML Engineer] {research:role}, who took charge of [model implementation] {research:contribution}.
|
|
1244
1040
|
|
|
1245
1041
|
## Research Activity {=research:research-activity .prov:Activity label}
|
|
1246
1042
|
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
Started: [2024-01-01] {prov:startedAtTime ^^xsd:date}
|
|
1250
|
-
Ended: [2024-03-15] {prov:endedAtTime ^^xsd:date}
|
|
1251
|
-
Associated with: [Research Team] {+research:authors ?prov:wasAssociatedWith}
|
|
1252
|
-
Plan: [Medical AI Research Plan] {+research:plan .prov:Plan ?prov:hadPlan}
|
|
1043
|
+
The project ran from [2024-01-01] {prov:startedAtTime ^^xsd:date} through [2024-03-15] {prov:endedAtTime ^^xsd:date}, carried out by the [Research Team] {+research:authors ?prov:wasAssociatedWith} according to the [Medical AI Research Plan] {+research:plan .prov:Plan ?prov:hadPlan} they had drafted the previous autumn.
|
|
1253
1044
|
|
|
1254
1045
|
## Dataset Collection {=research:dataset-collection .prov:Activity label}
|
|
1255
1046
|
|
|
1256
|
-
|
|
1047
|
+
Assembling a dataset of sufficient quality and scale was the first major challenge.
|
|
1257
1048
|
|
|
1258
|
-
### Primary Dataset {=data:primary-dataset .research:Dataset label}
|
|
1259
|
-
Source: [GitHub Medical Imaging Repository] {research:source}
|
|
1260
|
-
Training samples: [80000] {data:trainCount ^^xsd:integer} DICOM images
|
|
1261
|
-
Validation samples: [10000] {data:valCount ^^xsd:integer} DICOM images
|
|
1262
|
-
Test samples: [10000] {data:testCount ^^xsd:integer} DICOM images
|
|
1263
|
-
Classes: [15] {data:classCount ^^xsd:integer} anatomical structures
|
|
1049
|
+
### Primary Dataset {=data:primary-dataset .research:Dataset .prov:Entity label}
|
|
1264
1050
|
|
|
1265
|
-
|
|
1266
|
-
Derived from: [Primary Dataset] {+data:primary-dataset ?prov:wasDerivedFrom}
|
|
1267
|
-
Resolution: [512x512] {data:resolution} grayscale
|
|
1268
|
-
Features: [Patient metadata] {data:features}
|
|
1269
|
-
Sample size: [1000] {data:patientCount ^^xsd:integer} patients
|
|
1051
|
+
The team sourced [80,000] {data:trainCount ^^xsd:integer} DICOM training images from the [GitHub Medical Imaging Repository] {research:source}, setting aside [10,000] {data:valCount ^^xsd:integer} for validation and another [10,000] {data:testCount ^^xsd:integer} for final testing. The images span [15] {data:classCount ^^xsd:integer} anatomical structures. It was assembled during the [dataset collection phase] {+research:dataset-collection ?prov:wasGeneratedBy}.
|
|
1270
1052
|
|
|
1271
|
-
|
|
1053
|
+
### Augmented Dataset {=data:augmented-dataset .research:Dataset .prov:Entity label}
|
|
1272
1054
|
|
|
1273
|
-
|
|
1055
|
+
Working from that [primary collection] {+data:primary-dataset ?prov:wasDerivedFrom}, the team produced a [512x512] {data:resolution} grayscale augmented set enriched with [patient metadata] {data:features}, covering [1,000] {data:patientCount ^^xsd:integer} individual patients to reduce demographic bias. This derived set was also [generated] {+research:dataset-collection ?prov:wasGeneratedBy} as part of the same collection activity.
|
|
1274
1056
|
|
|
1275
|
-
|
|
1276
|
-
Ended: [2024-02-28] {prov:endedAtTime ^^xsd:date}
|
|
1277
|
-
Used: [Primary Dataset] {+data:primary-dataset ?prov:used} and [Augmented Dataset] {+data:augmented-dataset ?prov:used}
|
|
1278
|
-
Associated with: [Dr. James Liu] {+research:james-liu ?prov:wasAssociatedWith} as ML Engineer
|
|
1279
|
-
Generated: [Trained Model] {+research:trained-model ?prov:generated}
|
|
1057
|
+
## Model Development {=research:model-development .prov:Activity label}
|
|
1280
1058
|
|
|
1281
|
-
|
|
1059
|
+
Training ran through February — from [2024-02-01] {prov:startedAtTime ^^xsd:date} to [2024-02-28] {prov:endedAtTime ^^xsd:date}. [Dr. James Liu] {+research:james-liu ?prov:wasAssociatedWith} drove the implementation, feeding the model both the [raw] {+data:primary-dataset ?prov:used} and [augmented] {+data:augmented-dataset ?prov:used} datasets. The process produced a [trained model artifact] {+research:trained-model ?prov:generated} ready for evaluation.
|
|
1282
1060
|
|
|
1283
|
-
|
|
1061
|
+
## Model Evaluation {=research:evaluation .prov:Activity label}
|
|
1284
1062
|
|
|
1285
|
-
|
|
1286
|
-
Used: [Trained Model] {+research:trained-model ?prov:used}
|
|
1287
|
-
Generated: [Evaluation Results] {+research:eval-results ?prov:generated}
|
|
1063
|
+
Evaluation began on [2024-03-01] {prov:startedAtTime ^^xsd:date}. The [trained model] {+research:trained-model ?prov:used} was put through a comprehensive test suite that yielded the [evaluation results] {+research:eval-results ?prov:generated} reported below.
|
|
1288
1064
|
|
|
1289
1065
|
### Performance Metrics {=research:metrics .prov:Entity label}
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1066
|
+
|
|
1067
|
+
The results were strong across the board. Training accuracy reached [94.5%] {research:trainAcc ^^xsd:decimal}, with validation holding at [92.3%] {research:valAcc ^^xsd:decimal} and the held-out test set at [91.8%] {research:testAcc ^^xsd:decimal}. The F1 score came in at [0.89] {research:f1 ^^xsd:decimal} and AUC-ROC at [0.93] {research:auc ^^xsd:decimal}, both statistically significant at [p < 0.05] {research:significance} across a sample of [1,000] {research:sampleSize ^^xsd:integer} patients.
|
|
1068
|
+
|
|
1069
|
+
## Paper Reports Clinical Accuracy {=research:stmt-accuracy .rdf:Statement .prov:Entity label}
|
|
1070
|
+
|
|
1071
|
+
**The research paper** {+research:paper ?rdf:subject} *reports* {+research:testAcc ?rdf:predicate} **91.8% test accuracy** {+research:metrics ?rdf:object}.
|
|
1072
|
+
Derived from: [Evaluation Results] {+research:eval-results ?prov:wasDerivedFrom}
|
|
1073
|
+
Generated by: [Model Evaluation] {+research:evaluation ?prov:wasGeneratedBy}
|
|
1074
|
+
Established: [2024-03-15T00:00:00Z] {prov:generatedAtTime ^^xsd:dateTime}
|
|
1075
|
+
|
|
1076
|
+
## Paper Was NASA-Funded {=research:stmt-publication .rdf:Statement .prov:Entity label}
|
|
1077
|
+
**The research paper** {+research:paper ?rdf:subject} *was funded by* {+prov:wasAttributedTo ?rdf:predicate} **NASA Space Medicine** {+research:nasa ?rdf:object}.
|
|
1078
|
+
Generated by: [Publication Activity] {+research:publication ?prov:wasGeneratedBy}
|
|
1079
|
+
Derived from: [Research Activity] {+research:research-activity ?prov:wasDerivedFrom}
|
|
1080
|
+
Established: [2024-04-15T00:00:00Z] {prov:generatedAtTime ^^xsd:dateTime}
|
|
1297
1081
|
|
|
1298
1082
|
## SHACL Validation Shapes
|
|
1299
1083
|
|
|
1300
1084
|
### Paper Validation Shape {=research:PaperShape .sh:NodeShape label}
|
|
1301
1085
|
|
|
1302
|
-
|
|
1086
|
+
To ensure the graph stays consistent, we defined a shape targeting every [Paper] {+research:Paper ?sh:targetClass} in the graph. Any paper must carry exactly [one title] {+#title ?sh:property sh:name}, at least [one author] {+#author ?sh:property sh:name}, and at least [one citation] {+#citation ?sh:property sh:name} — otherwise it isn't a complete scientific record.
|
|
1303
1087
|
|
|
1304
1088
|
### Paper must have exactly one title. {=#title .sh:PropertyShape sh:message}
|
|
1305
|
-
|
|
1306
|
-
Required: [1] {sh:minCount sh:maxCount ^^xsd:integer}
|
|
1089
|
+
The [rdfs:label] {+rdfs:label ?sh:path} property holds the title — exactly [1] {sh:minCount sh:maxCount ^^xsd:integer}.
|
|
1307
1090
|
|
|
1308
1091
|
## Paper must have at least one author. {=#author .sh:PropertyShape sh:message}
|
|
1309
|
-
|
|
1310
|
-
Required: [1] {sh:minCount ^^xsd:integer}
|
|
1092
|
+
Every paper needs at least [1] {sh:minCount ^^xsd:integer} value on [author] {+research:author ?sh:path}.
|
|
1311
1093
|
|
|
1312
1094
|
## Paper must have at least one citation. {=#citation .sh:PropertyShape sh:message}
|
|
1313
|
-
|
|
1314
|
-
Required: [1] {sh:minCount ^^xsd:integer}
|
|
1095
|
+
Same idea for citations: [citation] {+research:citation ?sh:path} must appear at least [1] {sh:minCount ^^xsd:integer} time.
|
|
1315
1096
|
|
|
1316
1097
|
### Test Data
|
|
1317
1098
|
|
|
1318
1099
|
#### Valid Paper {=research:valid-paper .research:Paper label}
|
|
1319
|
-
|
|
1320
|
-
Authors: [Dr. Sarah Martinez] {+research:sarah-martinez ?research:author}
|
|
1321
|
-
Citations: [15] {research:citation ^^xsd:integer}
|
|
1100
|
+
This is **[Medical Imaging AI Research] {rdfs:label}**, authored by [Dr. Sarah Martinez] {+research:sarah-martinez ?research:author} and carrying [15] {research:citation ^^xsd:integer} citations — it should pass all three constraints cleanly.
|
|
1322
1101
|
|
|
1323
1102
|
#### Invalid Paper {=research:invalid-paper .research:Paper label}
|
|
1324
|
-
|
|
1325
|
-
Authors: [] {research:citation}
|
|
1103
|
+
This stub has a title of [Untitled] {rdfs:label} but no author and no citation value — [intentionally incomplete] {research:citation} to demonstrate what a violation looks like.
|
|
1326
1104
|
|
|
1327
1105
|
## Funding and Provenance
|
|
1328
1106
|
|
|
1329
1107
|
### Funding Entity {=research:funding .prov:Entity label}
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
Source: [NASA Space Medicine] {+research:nasa ?prov:wasAttributedTo .prov:Organization}
|
|
1333
|
-
Period: [2024-2026] {research:period}
|
|
1108
|
+
|
|
1109
|
+
The work was made possible by grant [NRA-2024-12345] {research:grantNumber}, a [$500,000] {research:amount ^^xsd:decimal} award from [NASA Space Medicine] {+research:nasa ?prov:wasAttributedTo .prov:Organization} running from [2024 to 2026] {research:period}.
|
|
1334
1110
|
|
|
1335
1111
|
### Publication Activity {=research:publication .prov:Activity label}
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
This demonstrates:
|
|
1340
|
-
- Complete PROV-O provenance chains
|
|
1341
|
-
- Dataset management with XSD typing
|
|
1342
|
-
- SHACL validation with self-documenting
|
|
1343
|
-
- Academic research lifecycle
|
|
1344
|
-
- Proper ontology integration
|
|
1112
|
+
|
|
1113
|
+
On [2024-04-15] {prov:startedAtTime ^^xsd:date} the team submitted [Medical Imaging AI Research] {+research:paper ?prov:used} and it was accepted by [Medical Journal] {+research:journal ?prov:wasGeneratedBy}. The funding, the data, the model, and the results all now have a complete provenance trail traceable through this document.
|
|
1345
1114
|
`,index:`# MD-LD Demo Examples
|
|
1346
1115
|
|
|
1347
1116
|
Quick start examples demonstrating core MD-LD patterns and features.
|
|
@@ -2858,9 +2627,9 @@ Quick start examples demonstrating core MD-LD patterns and features.
|
|
|
2858
2627
|
}
|
|
2859
2628
|
|
|
2860
2629
|
.details[open] .rdf-graph[height="300"] {
|
|
2861
|
-
height:
|
|
2862
|
-
min-height:
|
|
2863
|
-
max-height:
|
|
2630
|
+
height: 400px !important;
|
|
2631
|
+
min-height: 400px !important;
|
|
2632
|
+
max-height: 400px !important;
|
|
2864
2633
|
}
|
|
2865
2634
|
|
|
2866
2635
|
/* Reserve space for collapsed content to prevent jumping */
|
|
@@ -2921,20 +2690,21 @@ Quick start examples demonstrating core MD-LD patterns and features.
|
|
|
2921
2690
|
|
|
2922
2691
|
/* Specific TTL styling */
|
|
2923
2692
|
#ttl {
|
|
2924
|
-
white-space: pre-wrap
|
|
2925
|
-
word-wrap: break-word
|
|
2926
|
-
word-break: break-word
|
|
2927
|
-
overflow-wrap: break-word
|
|
2928
|
-
max-width: 100
|
|
2693
|
+
white-space: pre-wrap;
|
|
2694
|
+
word-wrap: break-word;
|
|
2695
|
+
word-break: break-word;
|
|
2696
|
+
overflow-wrap: break-word;
|
|
2697
|
+
max-width: 100%;
|
|
2698
|
+
padding: 1em;
|
|
2929
2699
|
}
|
|
2930
2700
|
|
|
2931
2701
|
/* Specific MDLD styling */
|
|
2932
2702
|
#mdld {
|
|
2933
|
-
white-space: pre-wrap
|
|
2934
|
-
word-wrap: break-word
|
|
2935
|
-
word-break: break-word
|
|
2936
|
-
overflow-wrap: break-word
|
|
2937
|
-
max-width: 100
|
|
2703
|
+
white-space: pre-wrap;
|
|
2704
|
+
word-wrap: break-word;
|
|
2705
|
+
word-break: break-word;
|
|
2706
|
+
overflow-wrap: break-word;
|
|
2707
|
+
max-width: 100%;
|
|
2938
2708
|
}
|
|
2939
2709
|
|
|
2940
2710
|
/* Specific quads output styling - prevent layout shifts */
|