Skip to content

Commit

Permalink
Remove collection from temp types linkeddata#355
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Oct 8, 2019
1 parent 7a9c7c3 commit 3320c43
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 95 deletions.
53 changes: 0 additions & 53 deletions src/node-internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,57 +117,4 @@ export default abstract class Node {
toString (): string {
throw new Error('Node.toString() is abstract - see the subclasses instead')
}

// /**
// * Creates an RDF Node from a native javascript value.
// * RDF Nodes are returned unchanged, undefined returned as itself.
// * @method fromValue
// * @param value - Any native Javascript value
// */
// static fromValue (value: ValueType | null): Node | Literal | undefined | null | Collection {
// if (typeof value === 'undefined' || value === null) {
// return value
// }
// const isNode = Object.prototype.hasOwnProperty.call(value, 'termType')
// if (isNode) { // a Node subclass or a Collection
// // @ts-ignore
// return value
// }
// if (Array.isArray(value)) {
// return new Collection(value)
// }
// return Literal.fromValue(value)
// }

// /**
// * Gets the javascript object equivalent to a node
// * @param term The RDF node
// */
// static toJS (term: Node | Literal) {
// if (term.elements) {
// return term.elements.map(Node.toJS) // Array node (not standard RDFJS)
// }
// // Node remains Node
// if (!term.hasOwnProperty('dataType')) {
// return term
// }
// const literalTerm = term as Literal
// // if (!Object.prototype.hasOwnProperty.call(term, 'dataType')) return term // Objects remain objects
// if (literalTerm.datatype.sameTerm(ns.xsd('boolean'))) {
// return literalTerm.value === '1'
// }
// if (literalTerm.datatype.sameTerm(ns.xsd('dateTime')) ||
// literalTerm.datatype.sameTerm(ns.xsd('date'))) {
// return new Date(literalTerm.value)
// }
// if (
// literalTerm.datatype.sameTerm(ns.xsd('integer')) ||
// literalTerm.datatype.sameTerm(ns.xsd('float')) ||
// literalTerm.datatype.sameTerm(ns.xsd('decimal'))
// ) {
// let z = Number(literalTerm.value)
// return Number(literalTerm.value)
// }
// return literalTerm.value
// }
}
42 changes: 0 additions & 42 deletions types-temp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,48 +18,6 @@ import { NamedNode } from './src';
// TypeScript Version: 3.0
// Acknowledgements: This work has been financed by Logilab SA, FRANCE, logilab.fr

/**
* A collection of other RDF nodes
*/
export interface Collection extends Node {
/**
* The identifier for this collection
*/
id: string;
/**
* The nodes in this collection
*/
elements: Node[];
/**
* Whether this collection is closed
*/
closed: boolean;
/**
* Initializes this collection
* @param initial The initial elements
*/
constructor(initial: ReadonlyArray<ValueType>);
/**
* Appends an element to this collection
* @param element The new element
*/
append(element: Node): number;
/**
* Closes this collection
*/
close(): boolean;
/**
* Removes the first element from the collection (and return it)
*/
shift(): Node;
/**
* Preprends the specified element to the colelction's front
* @param element The element to preprend
*/
unshift(element: Node): number;
static termType: string;
}

/**
* Variables are placeholders used in patterns to be matched.
* In cwm they are symbols which are the formula's list of quantified variables.
Expand Down

0 comments on commit 3320c43

Please sign in to comment.