eyeling 1.15.13 → 1.16.0

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.
Files changed (60) hide show
  1. package/HANDBOOK.md +25 -5
  2. package/README.md +78 -1
  3. package/arctifacts/README.md +57 -0
  4. package/eyeling.js +894 -9
  5. package/index.d.ts +184 -1
  6. package/index.js +17 -7
  7. package/lib/engine.js +92 -8
  8. package/lib/entry.js +3 -0
  9. package/lib/rdfjs.js +795 -0
  10. package/package.json +2 -2
  11. package/test/api.test.js +263 -0
  12. package/tools/bundle.js +1 -1
  13. package/follows-from/index.html +0 -549
  14. package/follows-from/library/index.md +0 -22
  15. package/follows-from/logo.svg +0 -12
  16. package/follows-from/manifesto.md +0 -48
  17. package/follows-from/method/index.md +0 -30
  18. package/follows-from/path/index.md +0 -20
  19. /package/{follows-from/artifacts → arctifacts}/ackermann.html +0 -0
  20. /package/{follows-from/artifacts → arctifacts}/auroracare.html +0 -0
  21. /package/{follows-from/artifacts → arctifacts}/bike-trip.html +0 -0
  22. /package/{follows-from/artifacts → arctifacts}/binomial-theorem.html +0 -0
  23. /package/{follows-from/artifacts → arctifacts}/bmi.html +0 -0
  24. /package/{follows-from/artifacts → arctifacts}/building-performance.html +0 -0
  25. /package/{follows-from/artifacts → arctifacts}/clinical-care.html +0 -0
  26. /package/{follows-from/artifacts → arctifacts}/collatz.html +0 -0
  27. /package/{follows-from/artifacts → arctifacts}/complex.html +0 -0
  28. /package/{follows-from/artifacts → arctifacts}/control-system.html +0 -0
  29. /package/{follows-from/artifacts → arctifacts}/delfour.html +0 -0
  30. /package/{follows-from/artifacts → arctifacts}/earthquake-epicenter.html +0 -0
  31. /package/{follows-from/artifacts → arctifacts}/eco-route.html +0 -0
  32. /package/{follows-from/artifacts → arctifacts}/euclid-infinitude.html +0 -0
  33. /package/{follows-from/artifacts → arctifacts}/euler-identity.html +0 -0
  34. /package/{follows-from/artifacts → arctifacts}/exoplanet-transit.html +0 -0
  35. /package/{follows-from/artifacts → arctifacts}/faltings-theorem.html +0 -0
  36. /package/{follows-from/artifacts → arctifacts}/fibonacci.html +0 -0
  37. /package/{follows-from/artifacts → arctifacts}/fundamental-theorem-arithmetic.html +0 -0
  38. /package/{follows-from/artifacts → arctifacts}/godel-numbering.html +0 -0
  39. /package/{follows-from/artifacts → arctifacts}/gps-bike.html +0 -0
  40. /package/{follows-from/artifacts → arctifacts}/gps-clinical-bench.html +0 -0
  41. /package/{follows-from/artifacts → arctifacts}/graph-french.html +0 -0
  42. /package/{follows-from/artifacts → arctifacts}/grass-molecular.html +0 -0
  43. /package/{follows-from/artifacts → arctifacts}/group-theory.html +0 -0
  44. /package/{follows-from/artifacts → arctifacts}/health-info.html +0 -0
  45. /package/{follows-from/artifacts → arctifacts}/kaprekar-constant.html +0 -0
  46. /package/{follows-from/artifacts → arctifacts}/lee.html +0 -0
  47. /package/{follows-from/artifacts → arctifacts}/linked-lists.html +0 -0
  48. /package/{follows-from/artifacts → arctifacts}/lldm.html +0 -0
  49. /package/{follows-from/artifacts → arctifacts}/matrix-multiplication.html +0 -0
  50. /package/{follows-from/artifacts → arctifacts}/matrix.html +0 -0
  51. /package/{follows-from/artifacts → arctifacts}/newton-raphson.html +0 -0
  52. /package/{follows-from/artifacts → arctifacts}/peano-factorial.html +0 -0
  53. /package/{follows-from/artifacts → arctifacts}/pi.html +0 -0
  54. /package/{follows-from/artifacts → arctifacts}/polynomial.html +0 -0
  55. /package/{follows-from/artifacts → arctifacts}/prime.html +0 -0
  56. /package/{follows-from/artifacts → arctifacts}/pythagorean-theorem.html +0 -0
  57. /package/{follows-from/artifacts → arctifacts}/rest-path.html +0 -0
  58. /package/{follows-from/artifacts → arctifacts}/roots-of-unity.html +0 -0
  59. /package/{follows-from/artifacts → arctifacts}/turing.html +0 -0
  60. /package/{follows-from/artifacts → arctifacts}/wind-turbines.html +0 -0
package/eyeling.js CHANGED
@@ -4701,6 +4701,13 @@ const {
4701
4701
  const { makeExplain } = require('./explain');
4702
4702
 
4703
4703
  const { tripleToN3, prettyPrintQueryTriples } = require('./printing');
4704
+ const {
4705
+ getDataFactory,
4706
+ internalTripleToRdfJsQuad,
4707
+ normalizeParsedReasonerInputSync,
4708
+ normalizeReasonerInputSync,
4709
+ normalizeReasonerInputAsync,
4710
+ } = require('./rdfjs');
4704
4711
 
4705
4712
  const trace = require('./trace');
4706
4713
  const { deterministicSkolemIdFromKey } = require('./skolem');
@@ -7515,24 +7522,41 @@ function forwardChainAndCollectLogQueryConclusions(facts, forwardRules, backRule
7515
7522
 
7516
7523
  // (proof printing + log:outputString moved to lib/explain.js)
7517
7524
 
7518
- function reasonStream(n3Text, opts = {}) {
7525
+ function reasonStream(input, opts = {}) {
7519
7526
  const {
7520
7527
  baseIri = null,
7521
7528
  proof = false,
7522
7529
  onDerived = null,
7523
7530
  includeInputFactsInClosure = true,
7524
7531
  enforceHttps = false,
7532
+ rdfjs = false,
7533
+ dataFactory = null,
7525
7534
  } = opts;
7526
7535
 
7536
+ const parsedInput = normalizeParsedReasonerInputSync(input);
7537
+ const rdfFactory = rdfjs ? getDataFactory(dataFactory) : null;
7538
+
7527
7539
  const __oldEnforceHttps = deref.getEnforceHttpsEnabled();
7528
7540
  deref.setEnforceHttpsEnabled(!!enforceHttps);
7529
7541
  proofCommentsEnabled = !!proof;
7530
7542
 
7531
- const toks = lex(n3Text);
7532
- const parser = new Parser(toks);
7533
- if (baseIri) parser.prefixes.setBase(baseIri);
7543
+ let prefixes, triples, frules, brules, logQueryRules;
7544
+
7545
+ if (parsedInput) {
7546
+ prefixes = parsedInput.prefixes;
7547
+ triples = parsedInput.triples;
7548
+ frules = parsedInput.frules;
7549
+ brules = parsedInput.brules;
7550
+ logQueryRules = parsedInput.logQueryRules;
7551
+ if (baseIri) prefixes.setBase(baseIri);
7552
+ } else {
7553
+ const n3Text = normalizeReasonerInputSync(input);
7554
+ const toks = lex(n3Text);
7555
+ const parser = new Parser(toks);
7556
+ if (baseIri) parser.prefixes.setBase(baseIri);
7534
7557
 
7535
- const [prefixes, triples, frules, brules, logQueryRules] = parser.parseDocument();
7558
+ [prefixes, triples, frules, brules, logQueryRules] = parser.parseDocument();
7559
+ }
7536
7560
  // Make the parsed prefixes available to log:trace output
7537
7561
  trace.setTracePrefixes(prefixes);
7538
7562
 
@@ -7561,17 +7585,21 @@ function reasonStream(n3Text, opts = {}) {
7561
7585
  // query-selected triples (not all derived facts).
7562
7586
  if (typeof onDerived === 'function') {
7563
7587
  for (const qdf of queryDerived) {
7564
- onDerived({ triple: tripleToN3(qdf.fact, prefixes), df: qdf });
7588
+ const payload = { triple: tripleToN3(qdf.fact, prefixes), df: qdf };
7589
+ if (rdfFactory) payload.quad = internalTripleToRdfJsQuad(qdf.fact, rdfFactory);
7590
+ onDerived(payload);
7565
7591
  }
7566
7592
  }
7567
7593
  } else {
7568
7594
  // Default mode: output only newly derived forward facts.
7569
7595
  derived = forwardChain(facts, frules, brules, (df) => {
7570
7596
  if (typeof onDerived === 'function') {
7571
- onDerived({
7597
+ const payload = {
7572
7598
  triple: tripleToN3(df.fact, prefixes),
7573
7599
  df,
7574
- });
7600
+ };
7601
+ if (rdfFactory) payload.quad = internalTripleToRdfJsQuad(df.fact, rdfFactory);
7602
+ onDerived(payload);
7575
7603
  }
7576
7604
  });
7577
7605
  }
@@ -7597,10 +7625,65 @@ function reasonStream(n3Text, opts = {}) {
7597
7625
  queryDerived,
7598
7626
  closureN3,
7599
7627
  };
7628
+
7629
+ if (rdfFactory) {
7630
+ __out.closureQuads = closureTriples.map((t) => internalTripleToRdfJsQuad(t, rdfFactory));
7631
+ __out.queryQuads = queryTriples.map((t) => internalTripleToRdfJsQuad(t, rdfFactory));
7632
+ }
7600
7633
  deref.setEnforceHttpsEnabled(__oldEnforceHttps);
7601
7634
  return __out;
7602
7635
  }
7603
7636
 
7637
+ function reasonRdfJs(input, opts = {}) {
7638
+ const { dataFactory = null, ...restOpts } = opts || {};
7639
+ const rdfFactory = getDataFactory(dataFactory);
7640
+
7641
+ const queue = [];
7642
+ const waiters = [];
7643
+ let done = false;
7644
+ let failure = null;
7645
+
7646
+ const flush = () => {
7647
+ while (waiters.length && (queue.length || done)) {
7648
+ const resolve = waiters.shift();
7649
+ if (queue.length) resolve({ value: queue.shift(), done: false });
7650
+ else if (failure) resolve(Promise.reject(failure));
7651
+ else resolve({ value: undefined, done: true });
7652
+ }
7653
+ };
7654
+
7655
+ Promise.resolve().then(async () => {
7656
+ try {
7657
+ const normalizedInput = await normalizeReasonerInputAsync(input);
7658
+ reasonStream(normalizedInput, {
7659
+ ...restOpts,
7660
+ rdfjs: false,
7661
+ onDerived: ({ df }) => {
7662
+ queue.push(internalTripleToRdfJsQuad(df.fact, rdfFactory));
7663
+ flush();
7664
+ },
7665
+ });
7666
+ } catch (e) {
7667
+ failure = e;
7668
+ } finally {
7669
+ done = true;
7670
+ flush();
7671
+ }
7672
+ });
7673
+
7674
+ return {
7675
+ [Symbol.asyncIterator]() {
7676
+ return this;
7677
+ },
7678
+ next() {
7679
+ if (queue.length) return Promise.resolve({ value: queue.shift(), done: false });
7680
+ if (failure) return Promise.reject(failure);
7681
+ if (done) return Promise.resolve({ value: undefined, done: true });
7682
+ return new Promise((resolve) => waiters.push(resolve));
7683
+ },
7684
+ };
7685
+ }
7686
+
7604
7687
  // Minimal export surface for Node + browser/worker
7605
7688
  function main() {
7606
7689
  // Lazily require to avoid hard cycles in the module graph.
@@ -7647,6 +7730,7 @@ function setTracePrefixes(v) {
7647
7730
 
7648
7731
  module.exports = {
7649
7732
  reasonStream,
7733
+ reasonRdfJs,
7650
7734
  collectLogQueryConclusions,
7651
7735
  forwardChainAndCollectLogQueryConclusions,
7652
7736
  collectOutputStringsFromFacts,
@@ -7692,10 +7776,13 @@ module.exports = {
7692
7776
  // can call into the reasoner like the original monolithic build did.
7693
7777
 
7694
7778
  const engine = require('./engine');
7779
+ const { dataFactory } = require('./rdfjs');
7695
7780
 
7696
7781
  module.exports = {
7697
7782
  // public
7698
7783
  reasonStream: engine.reasonStream,
7784
+ reasonRdfJs: engine.reasonRdfJs,
7785
+ rdfjs: dataFactory,
7699
7786
  main: engine.main,
7700
7787
  version: engine.version,
7701
7788
 
@@ -10387,6 +10474,804 @@ function prettyPrintQueryTriples(triples, prefixes) {
10387
10474
 
10388
10475
  module.exports = { termToN3, tripleToN3, prettyPrintQueryTriples };
10389
10476
 
10477
+ };
10478
+ __modules["lib/rdfjs.js"] = function(require, module, exports){
10479
+ /**
10480
+ * Eyeling Reasoner — RDF/JS compatibility helpers
10481
+ *
10482
+ * A lightweight RDF/JS DataFactory plus adapters between Eyeling's internal
10483
+ * N3 term model and RDF/JS terms/quads.
10484
+ */
10485
+
10486
+ 'use strict';
10487
+
10488
+ const {
10489
+ XSD_NS,
10490
+ Literal: InternalLiteral,
10491
+ Iri,
10492
+ Blank,
10493
+ Var,
10494
+ ListTerm,
10495
+ OpenListTerm,
10496
+ GraphTerm,
10497
+ Triple,
10498
+ Rule,
10499
+ PrefixEnv,
10500
+ literalParts,
10501
+ } = require('./prelude');
10502
+ const { termToN3, tripleToN3 } = require('./printing');
10503
+
10504
+ function isObject(value) {
10505
+ return value != null && typeof value === 'object';
10506
+ }
10507
+
10508
+ function isIterable(value) {
10509
+ return value != null && typeof value[Symbol.iterator] === 'function';
10510
+ }
10511
+
10512
+ function isAsyncIterable(value) {
10513
+ return value != null && typeof value[Symbol.asyncIterator] === 'function';
10514
+ }
10515
+
10516
+ function getTypeTag(value) {
10517
+ if (!isObject(value)) return '';
10518
+ if (typeof value._type === 'string' && value._type) return value._type;
10519
+ if (value.constructor && typeof value.constructor.name === 'string' && value.constructor.name)
10520
+ return value.constructor.name;
10521
+ return '';
10522
+ }
10523
+
10524
+ function isRdfJsTerm(value) {
10525
+ return isObject(value) && typeof value.termType === 'string' && typeof value.value === 'string';
10526
+ }
10527
+
10528
+ function isRdfJsQuad(value) {
10529
+ return (
10530
+ isObject(value) &&
10531
+ value.termType === 'Quad' &&
10532
+ isRdfJsTerm(value.subject) &&
10533
+ isRdfJsTerm(value.predicate) &&
10534
+ isRdfJsTerm(value.object) &&
10535
+ isRdfJsTerm(value.graph)
10536
+ );
10537
+ }
10538
+
10539
+ function isEyelingPrefixEnvLike(value) {
10540
+ if (value instanceof PrefixEnv) return true;
10541
+ return isObject(value) && (getTypeTag(value) === 'PrefixEnv' || (isObject(value.map) && 'baseIri' in value));
10542
+ }
10543
+
10544
+ function isEyelingTripleLike(value) {
10545
+ if (value instanceof Triple) return true;
10546
+ return isObject(value) && (getTypeTag(value) === 'Triple' || ('s' in value && 'p' in value && 'o' in value));
10547
+ }
10548
+
10549
+ function isEyelingRuleLike(value) {
10550
+ if (value instanceof Rule) return true;
10551
+ return (
10552
+ isObject(value) &&
10553
+ (getTypeTag(value) === 'Rule' || (Array.isArray(value.premise) && Array.isArray(value.conclusion)))
10554
+ );
10555
+ }
10556
+
10557
+ function isEyelingAstBundleLike(value) {
10558
+ return (
10559
+ Array.isArray(value) &&
10560
+ value.length >= 4 &&
10561
+ value.length <= 5 &&
10562
+ (value[0] == null || isEyelingPrefixEnvLike(value[0])) &&
10563
+ Array.isArray(value[1]) &&
10564
+ Array.isArray(value[2]) &&
10565
+ Array.isArray(value[3])
10566
+ );
10567
+ }
10568
+
10569
+ function termEquals(self, other) {
10570
+ if (!other || typeof other !== 'object') return false;
10571
+ if (self.termType !== other.termType) return false;
10572
+ if (self.value !== other.value) return false;
10573
+
10574
+ if (self.termType === 'Literal') {
10575
+ return (
10576
+ !!self.datatype &&
10577
+ typeof self.datatype.equals === 'function' &&
10578
+ self.datatype.equals(other.datatype) &&
10579
+ self.language === (other.language || '')
10580
+ );
10581
+ }
10582
+
10583
+ if (self.termType === 'Quad') {
10584
+ return (
10585
+ self.subject.equals(other.subject) &&
10586
+ self.predicate.equals(other.predicate) &&
10587
+ self.object.equals(other.object) &&
10588
+ self.graph.equals(other.graph)
10589
+ );
10590
+ }
10591
+
10592
+ return true;
10593
+ }
10594
+
10595
+ class NamedNode {
10596
+ constructor(value) {
10597
+ this.termType = 'NamedNode';
10598
+ this.value = String(value);
10599
+ }
10600
+
10601
+ equals(other) {
10602
+ return termEquals(this, other);
10603
+ }
10604
+ }
10605
+
10606
+ class BlankNode {
10607
+ constructor(value) {
10608
+ this.termType = 'BlankNode';
10609
+ this.value = String(value);
10610
+ }
10611
+
10612
+ equals(other) {
10613
+ return termEquals(this, other);
10614
+ }
10615
+ }
10616
+
10617
+ class Variable {
10618
+ constructor(value) {
10619
+ this.termType = 'Variable';
10620
+ this.value = String(value);
10621
+ }
10622
+
10623
+ equals(other) {
10624
+ return termEquals(this, other);
10625
+ }
10626
+ }
10627
+
10628
+ class DefaultGraph {
10629
+ constructor() {
10630
+ this.termType = 'DefaultGraph';
10631
+ this.value = '';
10632
+ }
10633
+
10634
+ equals(other) {
10635
+ return termEquals(this, other);
10636
+ }
10637
+ }
10638
+
10639
+ class Literal {
10640
+ constructor(value, languageOrDatatype) {
10641
+ this.termType = 'Literal';
10642
+ this.value = String(value);
10643
+ this.language = '';
10644
+ this.datatype = null;
10645
+
10646
+ if (typeof languageOrDatatype === 'string') {
10647
+ this.language = languageOrDatatype;
10648
+ this.datatype = new NamedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString');
10649
+ } else if (isRdfJsTerm(languageOrDatatype)) {
10650
+ this.datatype = languageOrDatatype;
10651
+ } else {
10652
+ this.datatype = new NamedNode(XSD_NS + 'string');
10653
+ }
10654
+ }
10655
+
10656
+ equals(other) {
10657
+ return termEquals(this, other);
10658
+ }
10659
+ }
10660
+
10661
+ class Quad {
10662
+ constructor(subject, predicate, object, graph) {
10663
+ this.termType = 'Quad';
10664
+ this.value = '';
10665
+ this.subject = subject;
10666
+ this.predicate = predicate;
10667
+ this.object = object;
10668
+ this.graph = graph || new DefaultGraph();
10669
+ }
10670
+
10671
+ equals(other) {
10672
+ return termEquals(this, other);
10673
+ }
10674
+ }
10675
+
10676
+ const defaultGraphSingleton = new DefaultGraph();
10677
+
10678
+ const dataFactory = {
10679
+ namedNode(value) {
10680
+ return new NamedNode(value);
10681
+ },
10682
+ blankNode(value) {
10683
+ return new BlankNode(value == null ? '' : value);
10684
+ },
10685
+ literal(value, languageOrDatatype) {
10686
+ return new Literal(value, languageOrDatatype);
10687
+ },
10688
+ variable(value) {
10689
+ return new Variable(value);
10690
+ },
10691
+ defaultGraph() {
10692
+ return defaultGraphSingleton;
10693
+ },
10694
+ quad(subject, predicate, object, graph) {
10695
+ return new Quad(subject, predicate, object, graph || defaultGraphSingleton);
10696
+ },
10697
+ };
10698
+
10699
+ function getDataFactory(factory) {
10700
+ return factory && typeof factory.quad === 'function' ? factory : dataFactory;
10701
+ }
10702
+
10703
+ function getLiteralLexicalKind(value) {
10704
+ if (typeof value !== 'string' || value.length === 0) return 'typed';
10705
+ if (value === 'true' || value === 'false') return 'boolean';
10706
+ if (/^[+-]?[0-9]+$/.test(value)) return 'integer';
10707
+ if (/^[+-]?(?:[0-9]*\.[0-9]+|[0-9]+\.)$/.test(value)) return 'decimal';
10708
+ if (/^[+-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)[eE][+-]?[0-9]+$/.test(value)) return 'double';
10709
+ return 'typed';
10710
+ }
10711
+
10712
+ function inferDatatypeForLexical(value) {
10713
+ switch (getLiteralLexicalKind(value)) {
10714
+ case 'boolean':
10715
+ return XSD_NS + 'boolean';
10716
+ case 'integer':
10717
+ return XSD_NS + 'integer';
10718
+ case 'decimal':
10719
+ return XSD_NS + 'decimal';
10720
+ case 'double':
10721
+ return XSD_NS + 'double';
10722
+ default:
10723
+ return XSD_NS + 'string';
10724
+ }
10725
+ }
10726
+
10727
+ function quotedLexicalToValue(lexical) {
10728
+ if (typeof lexical !== 'string' || lexical.length < 2 || lexical[0] !== '"' || lexical[lexical.length - 1] !== '"') {
10729
+ return lexical;
10730
+ }
10731
+ try {
10732
+ return JSON.parse(lexical);
10733
+ } catch {
10734
+ return lexical.slice(1, -1);
10735
+ }
10736
+ }
10737
+
10738
+ function splitLiteralLexAndLang(value) {
10739
+ if (typeof value !== 'string') return { lexical: value, language: '' };
10740
+ if (!(value.startsWith('"') && value.length >= 2)) return { lexical: value, language: '' };
10741
+ const lastQuote = value.lastIndexOf('"');
10742
+ if (lastQuote <= 0 || lastQuote >= value.length - 1 || value[lastQuote + 1] !== '@') {
10743
+ return { lexical: value, language: '' };
10744
+ }
10745
+ const language = value.slice(lastQuote + 2);
10746
+ if (!/^[A-Za-z]+(?:-[A-Za-z0-9]+)*$/.test(language)) {
10747
+ return { lexical: value, language: '' };
10748
+ }
10749
+ return { lexical: value.slice(0, lastQuote + 1), language };
10750
+ }
10751
+
10752
+ function internalLiteralToRdfJs(term, factory) {
10753
+ const rdfFactory = getDataFactory(factory);
10754
+ const [lexicalWithMaybeLang, datatypeIri] = literalParts(term.value);
10755
+ const { lexical, language } = splitLiteralLexAndLang(lexicalWithMaybeLang);
10756
+ const isQuotedLexical =
10757
+ typeof lexical === 'string' && lexical.length >= 2 && lexical[0] === '"' && lexical[lexical.length - 1] === '"';
10758
+ const value = isQuotedLexical ? quotedLexicalToValue(lexical) : lexical;
10759
+
10760
+ if (language) return rdfFactory.literal(value, language);
10761
+ if (datatypeIri) return rdfFactory.literal(value, rdfFactory.namedNode(datatypeIri));
10762
+ return rdfFactory.literal(value, rdfFactory.namedNode(inferDatatypeForLexical(lexical)));
10763
+ }
10764
+
10765
+ function unsupportedRdfJsTerm(term, position) {
10766
+ const kind = term && term.constructor && term.constructor.name ? term.constructor.name : typeof term;
10767
+ const where = position ? ` in ${position}` : '';
10768
+ throw new TypeError(`Cannot convert N3-only term ${kind}${where} to RDF/JS`);
10769
+ }
10770
+
10771
+ function internalTermToRdfJs(term, factory, position) {
10772
+ const rdfFactory = getDataFactory(factory);
10773
+ if (term instanceof Iri) return rdfFactory.namedNode(term.value);
10774
+ if (term instanceof Blank) {
10775
+ const label = typeof term.label === 'string' && term.label.startsWith('_:') ? term.label.slice(2) : term.label;
10776
+ return rdfFactory.blankNode(label);
10777
+ }
10778
+ if (term instanceof Var) return rdfFactory.variable(term.name);
10779
+ if (term instanceof InternalLiteral) return internalLiteralToRdfJs(term, rdfFactory);
10780
+ return unsupportedRdfJsTerm(term, position);
10781
+ }
10782
+
10783
+ function internalTripleToRdfJsQuad(triple, factory) {
10784
+ const rdfFactory = getDataFactory(factory);
10785
+ return rdfFactory.quad(
10786
+ internalTermToRdfJs(triple.s, rdfFactory, 'subject'),
10787
+ internalTermToRdfJs(triple.p, rdfFactory, 'predicate'),
10788
+ internalTermToRdfJs(triple.o, rdfFactory, 'object'),
10789
+ rdfFactory.defaultGraph(),
10790
+ );
10791
+ }
10792
+
10793
+ function escapeStringForN3(value) {
10794
+ return JSON.stringify(String(value));
10795
+ }
10796
+
10797
+ function assertSupportedRdfJsTerm(term, position) {
10798
+ if (!isRdfJsTerm(term)) {
10799
+ throw new TypeError(`Expected an RDF/JS term in ${position}`);
10800
+ }
10801
+ }
10802
+
10803
+ function rdfJsTermToN3(term, position = 'term') {
10804
+ assertSupportedRdfJsTerm(term, position);
10805
+
10806
+ switch (term.termType) {
10807
+ case 'NamedNode':
10808
+ return `<${term.value}>`;
10809
+ case 'BlankNode':
10810
+ return `_:${term.value}`;
10811
+ case 'Variable':
10812
+ return `?${term.value}`;
10813
+ case 'DefaultGraph':
10814
+ throw new TypeError(`DefaultGraph is not a valid standalone N3 term in ${position}`);
10815
+ case 'Literal': {
10816
+ const lang = typeof term.language === 'string' ? term.language : '';
10817
+ const datatype = term.datatype && term.datatype.termType === 'NamedNode' ? term.datatype.value : null;
10818
+ const lexical = escapeStringForN3(term.value);
10819
+ if (lang) return `${lexical}@${lang}`;
10820
+ if (!datatype || datatype === XSD_NS + 'string') return lexical;
10821
+ return `${lexical}^^<${datatype}>`;
10822
+ }
10823
+ case 'Quad':
10824
+ throw new TypeError(`Quoted triple terms are not supported in ${position}`);
10825
+ default:
10826
+ throw new TypeError(`Unsupported RDF/JS termType ${JSON.stringify(term.termType)} in ${position}`);
10827
+ }
10828
+ }
10829
+
10830
+ function rdfJsTermToInternal(term, position = 'term') {
10831
+ assertSupportedRdfJsTerm(term, position);
10832
+
10833
+ switch (term.termType) {
10834
+ case 'NamedNode':
10835
+ return new Iri(term.value);
10836
+ case 'BlankNode':
10837
+ return new Blank(`_:${term.value}`);
10838
+ case 'Variable':
10839
+ return new Var(term.value);
10840
+ case 'Literal':
10841
+ return new InternalLiteral(rdfJsTermToN3(term, position));
10842
+ case 'DefaultGraph':
10843
+ throw new TypeError(`DefaultGraph is not a valid standalone N3 term in ${position}`);
10844
+ case 'Quad':
10845
+ throw new TypeError(`Quoted triple terms are not supported in ${position}`);
10846
+ default:
10847
+ throw new TypeError(`Unsupported RDF/JS termType ${JSON.stringify(term.termType)} in ${position}`);
10848
+ }
10849
+ }
10850
+
10851
+ function rdfJsQuadToInternalTriple(quad) {
10852
+ if (!isRdfJsQuad(quad)) throw new TypeError('Expected an RDF/JS Quad');
10853
+ if (quad.graph.termType !== 'DefaultGraph') {
10854
+ throw new TypeError('Named graph quads are not supported by Eyeling input; use the default graph only');
10855
+ }
10856
+ return new Triple(
10857
+ rdfJsTermToInternal(quad.subject, 'quad.subject'),
10858
+ rdfJsTermToInternal(quad.predicate, 'quad.predicate'),
10859
+ rdfJsTermToInternal(quad.object, 'quad.object'),
10860
+ );
10861
+ }
10862
+
10863
+ function rdfJsQuadToN3(quad) {
10864
+ if (!isRdfJsQuad(quad)) throw new TypeError('Expected an RDF/JS Quad');
10865
+ if (quad.graph.termType !== 'DefaultGraph') {
10866
+ throw new TypeError('Named graph quads are not supported by Eyeling input; use the default graph only');
10867
+ }
10868
+ return `${rdfJsTermToN3(quad.subject, 'quad.subject')} ${rdfJsTermToN3(quad.predicate, 'quad.predicate')} ${rdfJsTermToN3(quad.object, 'quad.object')}.`;
10869
+ }
10870
+
10871
+ function collectIterableToArray(iterable, label) {
10872
+ if (!isIterable(iterable)) throw new TypeError(`${label} must be an iterable of RDF/JS quads`);
10873
+ return Array.from(iterable);
10874
+ }
10875
+
10876
+ async function collectAsyncIterableToArray(iterable, label) {
10877
+ if (isIterable(iterable)) return Array.from(iterable);
10878
+ if (!isAsyncIterable(iterable)) throw new TypeError(`${label} must be an iterable or async iterable of RDF/JS quads`);
10879
+ const out = [];
10880
+ for await (const item of iterable) out.push(item);
10881
+ return out;
10882
+ }
10883
+
10884
+ function pickInputQuadIterable(input) {
10885
+ if (!isObject(input)) return null;
10886
+ if (input.quads != null) return { value: input.quads, label: 'input.quads' };
10887
+ if (input.dataset != null) return { value: input.dataset, label: 'input.dataset' };
10888
+ if (input.facts != null) return { value: input.facts, label: 'input.facts' };
10889
+ return null;
10890
+ }
10891
+
10892
+ function getRulesText(input) {
10893
+ if (!isObject(input)) return '';
10894
+ return '';
10895
+ }
10896
+
10897
+ function getFactsText(input) {
10898
+ if (!isObject(input)) return '';
10899
+ for (const key of ['factsN3', 'n3Facts']) {
10900
+ if (typeof input[key] === 'string') return input[key];
10901
+ }
10902
+ return '';
10903
+ }
10904
+
10905
+ function getPrefixesText(input) {
10906
+ if (!isObject(input)) return '';
10907
+ for (const key of ['prefixesN3', 'n3Prefixes']) {
10908
+ if (typeof input[key] === 'string') return input[key];
10909
+ }
10910
+ return '';
10911
+ }
10912
+
10913
+ function joinN3Sections(parts) {
10914
+ return parts
10915
+ .filter((part) => typeof part === 'string' && part.length > 0)
10916
+ .map((part) => (part.endsWith('\n') ? part : part + '\n'))
10917
+ .join('');
10918
+ }
10919
+
10920
+ function reviveHeadBlankLabels(value) {
10921
+ if (value instanceof Set) return new Set(value);
10922
+ if (Array.isArray(value)) return new Set(value.map((item) => String(item)));
10923
+ return new Set();
10924
+ }
10925
+
10926
+ function reviveEyelingTerm(value) {
10927
+ if (value instanceof Iri || value instanceof InternalLiteral || value instanceof Var || value instanceof Blank)
10928
+ return value;
10929
+ if (value instanceof ListTerm || value instanceof OpenListTerm || value instanceof GraphTerm) return value;
10930
+
10931
+ const tag = getTypeTag(value);
10932
+
10933
+ switch (tag) {
10934
+ case 'Iri':
10935
+ return new Iri(value.value);
10936
+ case 'Literal':
10937
+ return new InternalLiteral(value.value);
10938
+ case 'Var':
10939
+ return new Var(value.name);
10940
+ case 'Blank':
10941
+ return new Blank(value.label);
10942
+ case 'ListTerm':
10943
+ return new ListTerm((value.elems || []).map((item) => reviveEyelingTerm(item)));
10944
+ case 'OpenListTerm':
10945
+ return new OpenListTerm(
10946
+ (value.prefix || []).map((item) => reviveEyelingTerm(item)),
10947
+ value.tailVar,
10948
+ );
10949
+ case 'GraphTerm':
10950
+ return new GraphTerm((value.triples || []).map((item) => reviveEyelingTriple(item)));
10951
+ default:
10952
+ break;
10953
+ }
10954
+
10955
+ if (isRdfJsTerm(value)) return rdfJsTermToInternal(value);
10956
+ throw new TypeError(`Unsupported Eyeling term object: ${JSON.stringify(tag || value)}`);
10957
+ }
10958
+
10959
+ function reviveEyelingTriple(value) {
10960
+ if (value instanceof Triple) return value;
10961
+ if (!isEyelingTripleLike(value)) throw new TypeError('Expected an Eyeling Triple-like object');
10962
+ return new Triple(reviveEyelingTerm(value.s), reviveEyelingTerm(value.p), reviveEyelingTerm(value.o));
10963
+ }
10964
+
10965
+ function reviveEyelingRule(value) {
10966
+ if (value instanceof Rule) return value;
10967
+ if (!isEyelingRuleLike(value)) throw new TypeError('Expected an Eyeling Rule-like object');
10968
+
10969
+ const rule = new Rule(
10970
+ (value.premise || []).map((item) => reviveEyelingTriple(item)),
10971
+ (value.conclusion || []).map((item) => reviveEyelingTriple(item)),
10972
+ value.isForward !== false,
10973
+ !!value.isFuse,
10974
+ reviveHeadBlankLabels(value.headBlankLabels),
10975
+ );
10976
+
10977
+ if (value.__dynamicConclusionTerm != null) {
10978
+ Object.defineProperty(rule, '__dynamicConclusionTerm', {
10979
+ value: reviveEyelingTerm(value.__dynamicConclusionTerm),
10980
+ enumerable: false,
10981
+ writable: false,
10982
+ configurable: true,
10983
+ });
10984
+ }
10985
+
10986
+ return rule;
10987
+ }
10988
+
10989
+ function revivePrefixEnv(value) {
10990
+ if (value instanceof PrefixEnv) return value;
10991
+ if (!isEyelingPrefixEnvLike(value)) return PrefixEnv.newDefault();
10992
+ return new PrefixEnv({ ...(value.map || {}) }, value.baseIri || '');
10993
+ }
10994
+
10995
+ function reviveRuleArray(value, label) {
10996
+ if (value == null) return [];
10997
+ if (!Array.isArray(value)) throw new TypeError(`${label} must be an array of Eyeling Rule objects`);
10998
+ return value.map((item) => reviveEyelingRule(item));
10999
+ }
11000
+
11001
+ function reviveTripleArray(value, label) {
11002
+ if (value == null) return [];
11003
+ if (!Array.isArray(value)) throw new TypeError(`${label} must be an array of Eyeling Triple objects`);
11004
+ return value.map((item) => reviveEyelingTriple(item));
11005
+ }
11006
+
11007
+ function serializePrefixEnv(prefixes) {
11008
+ const pref = revivePrefixEnv(prefixes);
11009
+ const out = [];
11010
+
11011
+ if (pref.baseIri) out.push(`@base <${pref.baseIri}> .`);
11012
+
11013
+ for (const [name, iri] of Object.entries(pref.map || {})) {
11014
+ if (!iri) continue;
11015
+ out.push(`@prefix ${name ? `${name}:` : ':'} <${iri}> .`);
11016
+ }
11017
+
11018
+ return out.join('\n');
11019
+ }
11020
+
11021
+ function serializeFormulaTriples(triples, prefixes) {
11022
+ if (!Array.isArray(triples) || triples.length === 0) return '{ }';
11023
+ return `{
11024
+ ${triples.map((tr) => ` ${tripleToN3(tr, prefixes)}`).join('\n')}
11025
+ }`;
11026
+ }
11027
+
11028
+ function serializeRuleHead(rule, prefixes) {
11029
+ if (rule.isFuse) return 'false';
11030
+ if (rule.__dynamicConclusionTerm) return termToN3(rule.__dynamicConclusionTerm, prefixes);
11031
+ if (!Array.isArray(rule.conclusion) || rule.conclusion.length === 0) return 'true';
11032
+ return serializeFormulaTriples(rule.conclusion, prefixes);
11033
+ }
11034
+
11035
+ function serializeRulePremise(rule, prefixes) {
11036
+ if (!Array.isArray(rule.premise) || rule.premise.length === 0) return 'true';
11037
+ return serializeFormulaTriples(rule.premise, prefixes);
11038
+ }
11039
+
11040
+ function serializeRule(rule, prefixes) {
11041
+ if (rule.isForward === false) {
11042
+ const head =
11043
+ rule.conclusion && rule.conclusion.length ? serializeFormulaTriples(rule.conclusion, prefixes) : 'true';
11044
+ return `${head} <= ${serializeRulePremise(rule, prefixes)} .`;
11045
+ }
11046
+ return `${serializeRulePremise(rule, prefixes)} => ${serializeRuleHead(rule, prefixes)} .`;
11047
+ }
11048
+
11049
+ function serializeQueryRule(rule, prefixes) {
11050
+ return `${serializeRulePremise(rule, prefixes)} log:query ${serializeRuleHead(rule, prefixes)} .`;
11051
+ }
11052
+
11053
+ function serializeEyelingDocument(doc) {
11054
+ const prefixes = revivePrefixEnv(doc.prefixes);
11055
+ const prefixText = serializePrefixEnv(prefixes);
11056
+ const tripleText = (doc.triples || []).map((tr) => tripleToN3(tr, prefixes)).join('\n');
11057
+ const fruleText = (doc.frules || []).map((rule) => serializeRule(rule, prefixes)).join('\n');
11058
+ const bruleText = (doc.brules || []).map((rule) => serializeRule(rule, prefixes)).join('\n');
11059
+ const qruleText = (doc.logQueryRules || []).map((rule) => serializeQueryRule(rule, prefixes)).join('\n');
11060
+ return joinN3Sections([prefixText, tripleText, fruleText, bruleText, qruleText]);
11061
+ }
11062
+
11063
+ function parseAstBundle(bundle) {
11064
+ if (!isEyelingAstBundleLike(bundle))
11065
+ throw new TypeError('Expected an Eyeling AST bundle [prefixes, triples, forwardRules, backwardRules,? queryRules]');
11066
+ return {
11067
+ prefixes: revivePrefixEnv(bundle[0]),
11068
+ triples: reviveTripleArray(bundle[1], 'ast[1]'),
11069
+ frules: reviveRuleArray(bundle[2], 'ast[2]'),
11070
+ brules: reviveRuleArray(bundle[3], 'ast[3]'),
11071
+ logQueryRules: reviveRuleArray(bundle[4] || [], 'ast[4]'),
11072
+ };
11073
+ }
11074
+
11075
+ function combineDocuments(base, extra) {
11076
+ return {
11077
+ prefixes: extra.prefixes || base.prefixes,
11078
+ triples: base.triples.concat(extra.triples || []),
11079
+ frules: base.frules.concat(extra.frules || []),
11080
+ brules: base.brules.concat(extra.brules || []),
11081
+ logQueryRules: base.logQueryRules.concat(extra.logQueryRules || []),
11082
+ };
11083
+ }
11084
+
11085
+ function emptyDocument() {
11086
+ return {
11087
+ prefixes: PrefixEnv.newDefault(),
11088
+ triples: [],
11089
+ frules: [],
11090
+ brules: [],
11091
+ logQueryRules: [],
11092
+ };
11093
+ }
11094
+
11095
+ function hasEyelingObjectInput(input) {
11096
+ if (isEyelingAstBundleLike(input)) return true;
11097
+ if (!isObject(input)) return false;
11098
+ if (
11099
+ isEyelingAstBundleLike(input.ast) ||
11100
+ isEyelingAstBundleLike(input.document) ||
11101
+ isEyelingAstBundleLike(input.rules)
11102
+ )
11103
+ return true;
11104
+ if (isEyelingPrefixEnvLike(input.prefixes)) return true;
11105
+ if (Array.isArray(input.triples) || Array.isArray(input.forwardRules) || Array.isArray(input.frules)) return true;
11106
+ if (Array.isArray(input.backwardRules) || Array.isArray(input.brules)) return true;
11107
+ if (Array.isArray(input.queryRules) || Array.isArray(input.logQueryRules) || Array.isArray(input.qrules)) return true;
11108
+ if (Array.isArray(input.rules) && input.rules.some((item) => isEyelingRuleLike(item))) return true;
11109
+ return false;
11110
+ }
11111
+
11112
+ function parseEyelingDocumentBase(input) {
11113
+ if (isEyelingAstBundleLike(input)) return parseAstBundle(input);
11114
+ if (!isObject(input)) return null;
11115
+
11116
+ let doc = emptyDocument();
11117
+ let found = false;
11118
+
11119
+ const embeddedAst = input.ast || input.document;
11120
+ if (isEyelingAstBundleLike(embeddedAst)) {
11121
+ doc = combineDocuments(doc, parseAstBundle(embeddedAst));
11122
+ found = true;
11123
+ }
11124
+
11125
+ if (isEyelingAstBundleLike(input.rules)) {
11126
+ doc = combineDocuments(doc, parseAstBundle(input.rules));
11127
+ found = true;
11128
+ } else if (Array.isArray(input.rules) && input.rules.some((item) => isEyelingRuleLike(item))) {
11129
+ doc.frules = doc.frules.concat(reviveRuleArray(input.rules, 'input.rules'));
11130
+ found = true;
11131
+ }
11132
+
11133
+ if (isEyelingPrefixEnvLike(input.prefixes)) {
11134
+ doc.prefixes = revivePrefixEnv(input.prefixes);
11135
+ found = true;
11136
+ }
11137
+
11138
+ if (Array.isArray(input.triples)) {
11139
+ doc.triples = doc.triples.concat(reviveTripleArray(input.triples, 'input.triples'));
11140
+ found = true;
11141
+ }
11142
+
11143
+ if (Array.isArray(input.forwardRules)) {
11144
+ doc.frules = doc.frules.concat(reviveRuleArray(input.forwardRules, 'input.forwardRules'));
11145
+ found = true;
11146
+ }
11147
+ if (Array.isArray(input.frules)) {
11148
+ doc.frules = doc.frules.concat(reviveRuleArray(input.frules, 'input.frules'));
11149
+ found = true;
11150
+ }
11151
+ if (Array.isArray(input.backwardRules)) {
11152
+ doc.brules = doc.brules.concat(reviveRuleArray(input.backwardRules, 'input.backwardRules'));
11153
+ found = true;
11154
+ }
11155
+ if (Array.isArray(input.brules)) {
11156
+ doc.brules = doc.brules.concat(reviveRuleArray(input.brules, 'input.brules'));
11157
+ found = true;
11158
+ }
11159
+ if (Array.isArray(input.queryRules)) {
11160
+ doc.logQueryRules = doc.logQueryRules.concat(reviveRuleArray(input.queryRules, 'input.queryRules'));
11161
+ found = true;
11162
+ }
11163
+ if (Array.isArray(input.logQueryRules)) {
11164
+ doc.logQueryRules = doc.logQueryRules.concat(reviveRuleArray(input.logQueryRules, 'input.logQueryRules'));
11165
+ found = true;
11166
+ }
11167
+ if (Array.isArray(input.qrules)) {
11168
+ doc.logQueryRules = doc.logQueryRules.concat(reviveRuleArray(input.qrules, 'input.qrules'));
11169
+ found = true;
11170
+ }
11171
+
11172
+ return found ? doc : null;
11173
+ }
11174
+
11175
+ function appendSyncQuadFacts(doc, input) {
11176
+ const quadsInfo = pickInputQuadIterable(input);
11177
+ if (!quadsInfo) return doc;
11178
+ const quads = collectIterableToArray(quadsInfo.value, quadsInfo.label);
11179
+ return {
11180
+ ...doc,
11181
+ triples: doc.triples.concat(quads.map((quad) => rdfJsQuadToInternalTriple(quad))),
11182
+ };
11183
+ }
11184
+
11185
+ async function appendAsyncQuadFacts(doc, input) {
11186
+ const quadsInfo = pickInputQuadIterable(input);
11187
+ if (!quadsInfo) return doc;
11188
+ const quads = await collectAsyncIterableToArray(quadsInfo.value, quadsInfo.label);
11189
+ return {
11190
+ ...doc,
11191
+ triples: doc.triples.concat(quads.map((quad) => rdfJsQuadToInternalTriple(quad))),
11192
+ };
11193
+ }
11194
+
11195
+ function normalizeParsedReasonerInputSync(input) {
11196
+ const baseDoc = parseEyelingDocumentBase(input);
11197
+ if (!baseDoc) return null;
11198
+ return appendSyncQuadFacts(baseDoc, input);
11199
+ }
11200
+
11201
+ async function normalizeParsedReasonerInputAsync(input) {
11202
+ const baseDoc = parseEyelingDocumentBase(input);
11203
+ if (!baseDoc) return null;
11204
+ return appendAsyncQuadFacts(baseDoc, input);
11205
+ }
11206
+
11207
+ function normalizeReasonerInputSync(input) {
11208
+ if (typeof input === 'string') return input;
11209
+ const parsed = normalizeParsedReasonerInputSync(input);
11210
+ if (parsed) return serializeEyelingDocument(parsed);
11211
+ if (!isObject(input)) {
11212
+ throw new TypeError(
11213
+ 'Reasoner input must be an N3 string, an Eyeling AST/rule object, or an object containing RDF/JS quads plus optional rules',
11214
+ );
11215
+ }
11216
+ if (typeof input.n3 === 'string') return input.n3;
11217
+
11218
+ const quadsInfo = pickInputQuadIterable(input);
11219
+ const rulesText = getRulesText(input);
11220
+ const factsText = getFactsText(input);
11221
+ const prefixesText = getPrefixesText(input);
11222
+
11223
+ if (!quadsInfo) {
11224
+ if (rulesText || factsText || prefixesText) return joinN3Sections([prefixesText, factsText, rulesText]);
11225
+ throw new TypeError('Input object must provide n3 text, Eyeling AST/rule objects, or RDF/JS quads/facts/dataset');
11226
+ }
11227
+
11228
+ const quads = collectIterableToArray(quadsInfo.value, quadsInfo.label);
11229
+ const quadText = quads.map((quad) => rdfJsQuadToN3(quad)).join('\n');
11230
+ return joinN3Sections([prefixesText, factsText, quadText, rulesText]);
11231
+ }
11232
+
11233
+ async function normalizeReasonerInputAsync(input) {
11234
+ if (typeof input === 'string') return input;
11235
+ const parsed = await normalizeParsedReasonerInputAsync(input);
11236
+ if (parsed) return serializeEyelingDocument(parsed);
11237
+ if (!isObject(input)) {
11238
+ throw new TypeError(
11239
+ 'Reasoner input must be an N3 string, an Eyeling AST/rule object, or an object containing RDF/JS quads plus optional rules',
11240
+ );
11241
+ }
11242
+ if (typeof input.n3 === 'string') return input.n3;
11243
+
11244
+ const quadsInfo = pickInputQuadIterable(input);
11245
+ const rulesText = getRulesText(input);
11246
+ const factsText = getFactsText(input);
11247
+ const prefixesText = getPrefixesText(input);
11248
+
11249
+ if (!quadsInfo) {
11250
+ if (rulesText || factsText || prefixesText) return joinN3Sections([prefixesText, factsText, rulesText]);
11251
+ throw new TypeError('Input object must provide n3 text, Eyeling AST/rule objects, or RDF/JS quads/facts/dataset');
11252
+ }
11253
+
11254
+ const quads = await collectAsyncIterableToArray(quadsInfo.value, quadsInfo.label);
11255
+ const quadText = quads.map((quad) => rdfJsQuadToN3(quad)).join('\n');
11256
+ return joinN3Sections([prefixesText, factsText, quadText, rulesText]);
11257
+ }
11258
+
11259
+ module.exports = {
11260
+ dataFactory,
11261
+ getDataFactory,
11262
+ isRdfJsTerm,
11263
+ isRdfJsQuad,
11264
+ rdfJsTermToN3,
11265
+ rdfJsQuadToN3,
11266
+ rdfJsQuadToInternalTriple,
11267
+ internalTermToRdfJs,
11268
+ internalTripleToRdfJsQuad,
11269
+ normalizeParsedReasonerInputSync,
11270
+ normalizeReasonerInputSync,
11271
+ normalizeReasonerInputAsync,
11272
+ hasEyelingObjectInput,
11273
+ };
11274
+
10390
11275
  };
10391
11276
  __modules["lib/rules.js"] = function(require, module, exports){
10392
11277
  /**
@@ -10689,7 +11574,7 @@ module.exports = {
10689
11574
  return m.exports;
10690
11575
  }
10691
11576
  const __entry = __loadEntry();
10692
- const __api = { reasonStream: __entry.reasonStream };
11577
+ const __api = { reasonStream: __entry.reasonStream, reasonRdfJs: __entry.reasonRdfJs };
10693
11578
 
10694
11579
  try { if (__outerModule && __outerModule.exports) __outerModule.exports = __api; } catch (_e) {}
10695
11580
  try { if (__outerSelf) __outerSelf.eyeling = __api; } catch (_e) {}