mdld-parse 0.9.6 → 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/dist/index.html CHANGED
@@ -30,11 +30,11 @@
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)}let u={subject:o.primarySubject,type:o.primaryType,label:o.primaryLabel};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(`
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=[],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\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(`
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(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replaceAll(`"`,`&quot;`).replaceAll(`'`,`&#39;`)}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">&lt;${W(a)}&gt;</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]:`
@@ -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
- Daily journal with proper PROV-O provenance and temporal structure.
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
- Includes records for [2026] {+j:2026/index ?prov:hadMember}.
785
+ ## Year 2026 {=j:2026/index .prov:Collection label}
786
786
 
787
- ## Year 2026 {=j:2026/index .prov:Activity .prov:Collection label}
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
- This is all notes made in 2026 collection. It includes monthly collections:
789
+ ## May 2026 {=j:2026/05/index .prov:Collection label}
790
790
 
791
- - January {+j:2026/01/index ?prov:hadMember}
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:Activity .prov:Collection label}
793
+ ## Week 2, May 2026 {=j:2026/05/week-2/index .prov:Collection label}
798
794
 
799
- Started: [2026-05-01T00:00:00+04:00] {prov:startedAtTime ^^xsd:dateTime}
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
- We have 5 weeks in May - [1-3] {+j:2026/05/week-1/index ?prov:hadMember}, [4-10] {+j:2026/05/week-2/index ?prov:hadMember}, [11-17] {+j:2026/05/week-3/index ?prov:hadMember}, [18-24] {+j:2026/05/week-4/index ?prov:hadMember}, [25-31] {+j:2026/05/week-5/index ?prov:hadMember}.
797
+ The week's daily entries are members of this collection:
802
798
 
803
799
  ======
804
800
 
805
- #### 06 May 2026 {=j:2026/05/06/index .prov:Activity label}
801
+ ### 06 May 2026 {=j:2026/05/06/index .prov:Activity label}
806
802
 
807
- It's our first record in [week 2] {+j:2026/05/week-2/index ?prov:wasInformedBy}.
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
- Complete day with activities, locations, and emotional state.
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
- Started: [2026-05-06T08:00:00+04:00] {prov:startedAtTime ^^xsd:dateTime}
812
- Ended: [2026-05-06T23:30:00+04:00] {prov:endedAtTime ^^xsd:dateTime}
807
+ #### Morning {=#morning .prov:Activity label}
813
808
 
814
- Includes these activities: [morning] {+#morning !prov:wasInformedBy}, [afternoon] {+#afternoon !prov:wasInformedBy} and [social] {+#social !prov:wasInformedBy}.
809
+ The morning started with a [walk] {+#walk ?prov:wasInformedBy} and then [coffee] {+#coffee-prep ?prov:wasInformedBy}.
815
810
 
816
- ### Morning Activities {=#morning .prov:Activity label}
811
+ ##### Morning Walk {=#walk .prov:Activity label}
817
812
 
818
- I had a [walk] {+#walk ?prov:wasInformedBy} and a [coffee] {+#coffee-prep ?prov:wasInformedBy}.
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
- **Morning Walk** {=#walk .prov:Activity label}
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
- **Coffee Preparation** {=#coffee-prep .prov:Activity ?prov:used}
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
- ### Afternoon Activities {=#afternoon .prov:Activity label}
819
+ #### Afternoon {=#afternoon .prov:Activity ?prov:wasInformedBy label}
833
820
 
834
- **Reading Session** {=#reading .prov:Activity}
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
- **Work Session** {+j:work .prov:Activity ?prov:used}
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
- ### Social Interactions {=#social .prov:Activity label}
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
- **Coffee Meeting** {+j:coffee-meeting .prov:Activity ?prov:used}
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
- ## Emotional State Tracking {=#emotional-state .prov:Entity label}
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
- Daily mood and energy levels with temporal context.
831
+ #### Social {=#social .prov:Activity ?prov:wasInformedBy label}
856
832
 
857
- ### Mood Data {=j:mood-data .prov:Entity label}
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
- ### Location History {=j:location-history .prov:Entity label}
864
- Places visited with frequency and context.
835
+ ### Daily Summary {=j:2026/05/06/summary .prov:Entity label}
865
836
 
866
- Locations:
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
- **Apples** {+food:apples .food:Ingredient ?food:hasIngredient label}
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
- ## Preparation Steps {=food:preparation .prov:Activity label}
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
- ### Step 1: Crust {=food:step-crust .prov:Activity label}
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
- Mixed dry ingredients: [flour] {+food:flour ?prov:used}, [sugar] {+food:sugar ?prov:used}, [salt] {+food:salt ?prov:used}. Cut in [cold butter] {+food:butter ?prov:used} until mixture resembles [coarse crumbs] {food:texture}. Form into [pie dish] {+food:pie-dish ?prov:used}.
850
+ ## Ingredients
934
851
 
935
- ### Step 2: Filling {=food:step-filling .prov:Activity label}
852
+ ### Crust
936
853
 
937
- Toss [apples] {+food:apples ?prov:used} with [cinnamon] {+food:cinnamon ?prov:used} and [lemon juice] {+food:lemon-juice ?prov:used}. Let sit for [10] {food:restTime ^^xsd:integer} minutes.
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
- ### Step 3: Assembly {=food:step-assembly .prov:Activity label}
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
- Add filling to crust. Cover with [top crust] {+food:top-crust .food:Ingredient ?prov:used}. Cut [vent holes] {+food:vents .food:Technique ?prov:used}.
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
- ### Step 4: Baking {=food:step-baking .prov:Activity label}
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
- Bake at [375°F] {food:bakeTemp ^^xsd:integer} for [45-55] {food:bakeTime ^^xsd:integer} minutes until [golden brown] {food:color} and [bubbly] {food:texture}.
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
- ## Recipe Relationships
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
- ### Variation {=food:variation .prov:Entity label}
866
+ ### Filling
950
867
 
951
- This recipe is a variation of [Classic Apple Pie] {+food:classic-apple-pie .schema:Recipe ?food:variationOf}.
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
- Also related: [Peach Pie] {+food:peach-pie .schema:Recipe ?food:similarRecipe} and [Apple Crumble] {+food:apple-crumble .schema:Recipe ?food:similarRecipe}.
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
- ## Nutrition Information {=food:nutrition .prov:Entity label}
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
- Per serving:
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
- ## Provenance
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
- ### Recipe Creation {=food:creation .prov:Activity label}
878
+ ## Making the Filling {=#step-filling .prov:Activity ?prov:wasInformedBy label}
966
879
 
967
- Created by: [Grandma Rose] {+food:grandma-rose .prov:Person ?prov:wasAssociatedWith}
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
- Generated: [Recipe Documentation] {+food:recipe-docs ?prov:generated}.
882
+ ## Assembly and Baking {=#step-baking .prov:Activity ?prov:wasInformedBy label}
973
883
 
974
- This demonstrates:
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
- - [2.5] {food:amount ^^xsd:decimal} cups
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
- - [6] {food:amount ^^xsd:integer} medium, peeled, sliced
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
- # Website Redesign {=proj:website .prov:Project label}
894
+ ## Team
995
895
 
996
- Website redesign project for Q2 2026 with modern responsive design.
896
+ Three people assembled under the [Q2 Website Plan] {+proj:q2-plan .prov:Plan label} to staff this project.
997
897
 
998
- ## Project Metadata {=proj:website-meta .prov:Entity label}
898
+ ### Alice Johnson {=proj:alice .prov:Person label}
999
899
 
1000
- Budget: [$25,000] {proj:budget ^^xsd:decimal}
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
- ## Team Formation Activity {=proj:team-formation .prov:Activity label}
902
+ ### Bob Smith {=proj:bob .prov:Person label}
1006
903
 
1007
- Started: [2026-05-15T09:00:00Z] {prov:startedAtTime ^^xsd:dateTime}
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
- Generated: [Team Structure] {+proj:team-structure ?prov:generated}
906
+ ### Carol Davis {=proj:carol .prov:Person label}
1012
907
 
1013
- ## Team Members
908
+ [carol@example.com] {proj:email} — [UX Designer] {proj:role}, responsible for user research through to final visual design.
1014
909
 
1015
- ### Project Manager {=proj:alice .prov:Person label}
910
+ ## Team Formation {=proj:team-formation .prov:Activity label}
1016
911
 
1017
- Name: [Alice Johnson] {rdfs:label}
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
- ### Lead Developer {=proj:bob .prov:Person label}
914
+ ## Design Phase {=proj:design-phase .prov:Activity ?prov:wasInformedBy label}
1022
915
 
1023
- Name: [Bob Smith] {rdfs:label}
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
- ### UX Designer {=proj:carol .prov:Person label}
918
+ ## Development Phase {=proj:dev-phase .prov:Activity ?prov:wasInformedBy label}
1028
919
 
1029
- Name: [Carol Davis] {rdfs:label}
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
- ## Project Tasks
922
+ ## Validation Shapes
1034
923
 
1035
- ### Design Phase {=proj:design-phase .prov:Activity label}
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
- Started: [2026-06-01] {prov:startedAtTime ^^xsd:date}
1038
- Ended: [2026-06-15] {prov:endedAtTime ^^xsd:date}
926
+ ### Project Shape {=proj:ProjectShape .sh:NodeShape label}
1039
927
 
1040
- Tasks:
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
- Generated: [Design Documentation] {+proj:design-docs ?prov:generated}
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
- ### Development Phase {=proj:dev-phase .prov:Activity label}
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
- Started: [2026-06-16] {prov:startedAtTime ^^xsd:date}
1050
- Ended: [2026-07-30] {prov:endedAtTime ^^xsd:date}
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
- Tasks:
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
- Generated: [Working Prototype] {+proj:prototype ?prov:generated}
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
- ## Project Relationships
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
- ### Dependencies {=proj:dependencies .rdfs:Resource label}
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
- The project depends on:
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
- ### Stakeholders {=proj:stakeholders .rdfs:Resource label}
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
- Key stakeholders:
1070
- - [Marketing Department] {+proj:marketing ?proj:stakeholder .prov:Organization}
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
- ## Delegation Pattern
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
- ### Development Delegation {=proj:dev-delegation .prov:Delegation ?prov:qualifiedDelegation}
959
+ ## Project Is On Schedule {=proj:stmt-schedule .rdf:Statement .prov:Entity label}
1076
960
 
1077
- Alice delegates frontend development to specialized team.
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
- Delegate: [Alice] {+proj:alice ?prov:delegate}
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
- This demonstrates:
1085
- - Complete PROV-O provenance chains
1086
- - Project lifecycle with phases
1087
- - Team formation and delegation
1088
- - Proper temporal properties
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
- # Apollo 11 Mission {=nasa:apollo11 .prov:Activity label}
975
+ # Cassini-Huygens Mission {=cassini:mission .prov:Activity label}
1095
976
 
1096
- Historic lunar landing mission with complete provenance tracking.
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
- ## Mission Overview {=nasa:mission-overview .prov:Entity label}
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
- Launch date: [1969-07-16] {nasa:launchDate ^^xsd:date}
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
- ## Mission Timeline {=nasa:timeline .prov:Activity label}
983
+ The spacecraft comprised two largely independent systems that separated after arrival at Saturn.
1107
984
 
1108
- Complete chronological sequence of mission events.
985
+ ### Cassini Orbiter {=cassini:orbiter .prov:Agent label}
1109
986
 
1110
- ### Launch Phase {=nasa:launch .prov:Activity label}
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
- ### Trans-Lunar Injection {=nasa:tli .prov:Activity label}
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
- ### Lunar Landing {=nasa:landing .prov:Activity label}
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
- ## Personnel {=nasa:crew .prov:Entity label}
993
+ ## Mission Timeline
1132
994
 
1133
- Mission crew with defined roles and responsibilities.
995
+ The mission unfolded in four major phases, each building on the last through a clean provenance chain.
1134
996
 
1135
- ### Mission Commander {=nasa:armstrong .prov:Person label}
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
- ### Lunar Module Pilot {=nasa:aldrin .prov:Person label}
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
- ### Command Module Pilot {=nasa:collins .prov:Person label}
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
- ## Equipment {=nasa:equipment .prov:Entity label}
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
- All mission hardware and systems used.
1005
+ ### Huygens Titan Descent {=cassini:titan-descent .prov:Activity ?prov:wasInformedBy label}
1156
1006
 
1157
- ### Launch Vehicle {=nasa:saturnv .nasa:Rocket label}
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
- ### Lunar Module {=nasa:eagle .nasa:Module label}
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
- ### Command Module {=nasa:columbia .nasa:Module label}
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
- ## Mission Objectives {=nasa:objectives .prov:Entity label}
1013
+ ## Key Findings
1176
1014
 
1177
- Primary goals and their achievement status.
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
- ### Primary Objective {=nasa:primary-goal .nasa:Goal label}
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
- ### Secondary Objectives
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
- #### Lunar Sample Collection {=nasa:sample-goal .nasa:Goal label}
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
- #### EVA Operations {=nasa:eva-goal .nasa:Goal label}
1192
- Description: [Conduct extravehicular activities] {rdfs:label}
1193
- Status: [Achieved] {nasa:achievementStatus}
1194
- EVA duration: [2h 18m] {nasa:evaDuration ^^xsd:string}
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
- Deep learning analysis of attention mechanisms for medical diagnosis.
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
- Research team with defined roles and contributions.
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
- Complete research lifecycle with proper provenance.
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
- Systematic dataset gathering and validation.
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
- ### Augmented Dataset {=data:augmented-dataset .research:Dataset label}
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
- ## Model Development {=research:model-development .prov:Activity label}
1053
+ ### Augmented Dataset {=data:augmented-dataset .research:Dataset .prov:Entity label}
1272
1054
 
1273
- Training process with resource tracking.
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
- Started: [2024-02-01] {prov:startedAtTime ^^xsd:date}
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
- ## Model Evaluation {=research:evaluation .prov:Activity label}
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
- Comprehensive testing with statistical validation.
1061
+ ## Model Evaluation {=research:evaluation .prov:Activity label}
1284
1062
 
1285
- Started: [2024-03-01] {prov:startedAtTime ^^xsd:date}
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
- Training accuracy: [94.5] {research:trainAcc ^^xsd:decimal}
1291
- Validation accuracy: [92.3] {research:valAcc ^^xsd:decimal}
1292
- Test accuracy: [91.8] {research:testAcc ^^xsd:decimal}
1293
- F1 score: [0.89] {research:f1 ^^xsd:decimal}
1294
- AUC-ROC: [0.93] {research:auc ^^xsd:decimal}
1295
- Statistical significance: [p < 0.05] {research:significance}
1296
- Sample size: [1000] {research:sampleSize ^^xsd:integer}
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
- Ensures scientific papers meet academic standards. Targets all instances of [Paper] {+research:Paper ?sh:targetClass} to have a [title] {+#title ?sh:property sh:name}, [authors] {+#author ?sh:property sh:name} and [citations] {+#citation ?sh:property sh:name}.
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
- Path: [title] {+rdfs:label ?sh:path}
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
- Path: [author] {+research:author ?sh:path}
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
- Path: [citation] {+research:citation ?sh:path}
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
- Title: [Medical Imaging AI Research] {rdfs:label}
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
- Title: [Untitled] {rdfs:label}
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
- Grant: [NRA-2024-12345] {research:grantNumber}
1331
- Amount: [$500,000] {research:amount ^^xsd:decimal}
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
- Published: [Medical Imaging AI Research] {+research:paper ?prov:used} in [Medical Journal] {+research:journal ?prov:wasGeneratedBy}
1337
- Date: [2024-04-15] {prov:startedAtTime ^^xsd:date}
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: 300px !important;
2862
- min-height: 300px !important;
2863
- max-height: 300px !important;
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 !important;
2925
- word-wrap: break-word !important;
2926
- word-break: break-word !important;
2927
- overflow-wrap: break-word !important;
2928
- max-width: 100% !important;
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 !important;
2934
- word-wrap: break-word !important;
2935
- word-break: break-word !important;
2936
- overflow-wrap: break-word !important;
2937
- max-width: 100% !important;
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 */