removes seemingly unnecessary method (that was even doing something weird recursively)
@@ -1161,16 +1161,6 @@ import won from "./won.js";
simplified["@context"] = needJsonLd["@context"];
return simplified;
}
- })
- .then(needJsonLd => {
- /*
- * The framing algorithm doesn't use arrays if there's
- * only a single `rdfs:member`/element in the list :|
- * Thus, we need to manually make sure all uses of
- * `rdfs:member` have an array as value.
- */
- ensureRdfsMemberArrays(needJsonLd);
- return needJsonLd;
});
return needJsonLdP;
@@ -1232,7 +1222,7 @@ import won from "./won.js";
// property path, collecting all reachable triples
// returns a JS RDF Interfaces Graph object
/*async*/ function loadStarshapedGraph(store, startUri, tree) {
- console.log("loadStarshapedGraph");
+ console.log("loadStarshapedGraph: startUri", startUri);
let prefixes = tree.prefixes;
if (prefixes != null) {
for (let key in prefixes) {
@@ -1527,31 +1517,6 @@ import won from "./won.js";
return triples.map(tripleToString).join("\n");
}
- /**
- * Impure function, that all cases of `rdfs:member` have. This
- * is necessary as the framing-algorithm doesn't use arrays in cases,
- * where there's only a single `rdfs:member` property.
- * an array as value.
- * @param needJsonLd
- * @param visited
- */
- function ensureRdfsMemberArrays(needJsonLd, visited = new Set()) {
- console.log(
- "ensureRdfsMemberArrays visitedSize:",
- visited.size(),
- " : ",
- needJsonLd
- );
- if (visited.has(needJsonLd)) return;
- visited.add(needJsonLd);
-
- for (const k of Object.keys(needJsonLd)) {
- if (k === "rdfs:member" && !is("Array", needJsonLd[k]))
- needJsonLd[k] = [needJsonLd[k]];
- ensureRdfsMemberArrays(needJsonLd[k], visited);
- }
- }
-
won.getEnvelopeDataForNeed = function(needUri, nodeUri) {
console.log(
"getEnvelopeDataForNeed: needUri:",
