src/future/linked.js
function LiteralBunch_operator(z_literal_filter) {
	// user wants to filter literal by language or datatype
	if('string' === typeof z_literal_filter) {
		// by language tag
		if('@' === z_literal_filter[0]) {
			// ref language tag
			let s_language = z_literal_filter.slice(1).toLowerCase();

			// apply filter
			this.terms = this.terms.filter((h_term) => {
				return s_language === h_term.language;
			});
		}
		// by datatype
		else {
			// resolve datatype iri
			let p_datatype = this.graph.resolve(z_literal_filter);

			// apply filter
			this.terms = this.terms.filter((h_term) => {
				return p_datatype === h_term.datatype;
			});
		}
	}
	// user wants to filter literal by a function
	else if('function' === typeof z_literal_filter) {
		// apply filter
		this.terms = this.terms.filter(z_literal_filter);
	}

	// results / no filtering
	return this;
}
function LiteralBunch_operator(z_literal_filter) {
	// user wants to filter literal by language or datatype
	if('string' === typeof z_literal_filter) {
		// by language tag
		if('@' === z_literal_filter[0]) {
			// ref language tag
			let s_language = z_literal_filter.slice(1).toLowerCase();

			// apply filter
			this.terms = this.terms.filter((h_term) => {
				return s_language === h_term.language;
			});
		}
		// by datatype
		else {
			// resolve datatype iri
			let p_datatype = this.graph.resolve(z_literal_filter);

			// apply filter
			this.terms = this.terms.filter((h_term) => {
				return p_datatype === h_term.datatype;
			});
		}
	}
	// user wants to filter literal by a function
	else if('function' === typeof z_literal_filter) {
		// apply filter
		this.terms = this.terms.filter(z_literal_filter);
	}

	// results / no filtering
	return this;
}
function LiteralBunch_operator ( z_literal_filter ) { // user wants to filter literal by language or datatype if ( 'string' === typeof z_literal_filter ) { // by language tag if ( '@' === z_literal_filter [ 0 ] ) { // ref language tag let s_language = z_literal_filter . slice ( 1 ) . toLowerCase ( ) ; // apply filter this . terms = this . terms . filter ( ( h_term ) => { return s_language === h_term . language ; } ) ; } // by datatype else { // resolve datatype iri let p_datatype = this . graph . resolve ( z_literal_filter ) ; // apply filter this . terms = this . terms . filter ( ( h_term ) => { return p_datatype === h_term . datatype ; } ) ; } } // user wants to filter literal by a function else if ( 'function' === typeof z_literal_filter ) { // apply filter this . terms = this . terms . filter ( z_literal_filter ) ; } // results / no filtering return this ; }
mutates the LiteralBunch exactly once with the given filter argument
mutates the LiteralBunch exactly once with the given filter argument