Comparing version 0.6.8 to 0.6.9
@@ -23,29 +23,30 @@ "use strict"; | ||
}); | ||
//listen for changes in the property set | ||
//TODO: review, turned off for now due to memory leak | ||
/*//listen for changes in the property set | ||
subject.onChange(property, (quads) => { | ||
quads.forEach((q) => { | ||
if (q.isRemoved) { | ||
this.some((shape) => { | ||
if (shape.node === q.object) { | ||
return super.delete(shape); | ||
} | ||
}); | ||
quads.forEach((q) => { | ||
if (q.isRemoved) { | ||
this.some((shape) => { | ||
if (shape.node === q.object) { | ||
return super.delete(shape); | ||
} | ||
else { | ||
//it may have already been added if this very shapeset was used directly to add an item to | ||
//(we need to add it directly as that is expected behaviour when you add something to a set) | ||
//so if we don't have an existing shape in here for the added node, then we add it | ||
if (!this.some((shape) => { | ||
return shape.node === q.object; | ||
})) { | ||
if (allowSubShapes) { | ||
super.add((0, ShapeClass_1.getShapeOrSubShape)(q.object, shapeClass)); | ||
} | ||
else { | ||
super.add(new shapeClass(q.object)); | ||
} | ||
} | ||
}); | ||
} else { | ||
//it may have already been added if this very shapeset was used directly to add an item to | ||
//(we need to add it directly as that is expected behaviour when you add something to a set) | ||
//so if we don't have an existing shape in here for the added node, then we add it | ||
if ( | ||
!this.some((shape) => { | ||
return shape.node === q.object; | ||
}) | ||
) { | ||
if (allowSubShapes) { | ||
super.add(getShapeOrSubShape(q.object, shapeClass)); | ||
} else { | ||
super.add(new (shapeClass as any)(q.object)); | ||
} | ||
}); | ||
}); | ||
} | ||
} | ||
}); | ||
});*/ | ||
} | ||
@@ -52,0 +53,0 @@ /** |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
export interface IFileStore { | ||
@@ -3,0 +4,0 @@ /** |
import { NodeSet } from '../collections/NodeSet'; | ||
import { BlankNode, NamedNode, Node } from '../models'; | ||
import { Shape } from './Shape'; | ||
/** | ||
* Class to work with rdf Lists | ||
* A list is a way to store an ORDERED array in RDF (so in the graph with triples) | ||
* For example: | ||
* person.location = ["Portugal","Bali"] | ||
* If the order of these 2 items matters then it can be stored as a list in the graph like this: | ||
* _:somePerson _:location _:list1 | ||
* _:list1 rdf:first "Portugal" | ||
* _:list1 rdf:rest _:list2 <-- continuation of the list can be found here | ||
* _:list2 rdf:first "Bali" | ||
* _:list2 rdf:rest rdf:nil <-- end of the list | ||
* | ||
*/ | ||
export declare class List extends Shape { | ||
@@ -5,0 +18,0 @@ static targetClass: NamedNode; |
@@ -13,2 +13,15 @@ "use strict"; | ||
const Shape_1 = require("./Shape"); | ||
/** | ||
* Class to work with rdf Lists | ||
* A list is a way to store an ORDERED array in RDF (so in the graph with triples) | ||
* For example: | ||
* person.location = ["Portugal","Bali"] | ||
* If the order of these 2 items matters then it can be stored as a list in the graph like this: | ||
* _:somePerson _:location _:list1 | ||
* _:list1 rdf:first "Portugal" | ||
* _:list1 rdf:rest _:list2 <-- continuation of the list can be found here | ||
* _:list2 rdf:first "Bali" | ||
* _:list2 rdf:rest rdf:nil <-- end of the list | ||
* | ||
*/ | ||
class List extends Shape_1.Shape { | ||
@@ -15,0 +28,0 @@ constructor(blanknode = new models_1.BlankNode()) { |
@@ -85,3 +85,5 @@ "use strict"; | ||
if (allowSubShapes) { | ||
shape = (0, ShapeClass_1.getMostSpecificShapes)(value, shape)[0]; | ||
//get the most specific shape that the value is an instance of, that also extends the base shape | ||
//or if no shape was given, just get the most specific shape of the value | ||
shape = (shape ? ((0, ShapeClass_1.getMostSpecificShapes)(value, shape)[0] || shape) : (0, ShapeClass_1.getMostSpecificShapes)(value)[0]) || Shape; | ||
} | ||
@@ -88,0 +90,0 @@ return new shape(value); |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { IFileStore } from '../interfaces/IFileStore'; | ||
@@ -3,0 +4,0 @@ export declare abstract class LinkedFileStorage { |
{ | ||
"name": "lincd", | ||
"license": "MPL-2.0", | ||
"version": "0.6.8", | ||
"version": "0.6.9", | ||
"description": "LINCD is a JavaScript library for building user interfaces with linked data (also known as 'structured data', or RDF)", | ||
@@ -13,4 +13,3 @@ "main": "lib/index.js", | ||
"format:check": "prettier --check .", | ||
"format:write": "prettier --write .", | ||
"prepack": "yarn version patch && npm exec lincd build production" | ||
"format:write": "prettier --write ." | ||
}, | ||
@@ -17,0 +16,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
13201
1557303