Transforms a triple into a fact.
@param t The triple
@param explicit True if the resulting fact is explicit, false otherwise (default: true)
@returns Object resulting fact
540227
function(t, explicit, notUsingValid) {
        if(explicit === undefined) {
            explicit = true;
        }
        return new Fact(t.predicate.toString(), t.subject.toString(), t.object.toString()/*.format()*/, [], explicit, [], [], notUsingValid, t.toString())
    }
565762
function(fact) {
        var subject, predicate, object;

        /*if (fact.fromTriple !== undefined) {
            return fact.fromTriple;
        }*/

        if(fact.falseFact) {
            return '';
        }

        subject = this.parseStrEntityToTurtle(fact.subject);
        predicate = this.parseStrEntityToTurtle(fact.predicate);
        object = this.parseStrEntityToTurtle(fact.object);

        if (subject && predicate && object) {
            return subject + ' ' + predicate + ' ' + object + ' . ';
        } else {
            return '';
        }
    }
1057836
public static MutableDoubleTuple toDoubleTuple(LongTuple longTuple)
    {
        int d = longTuple.getSize();
        MutableDoubleTuple doubleTuple = DoubleTuples.create(d);
        for (int i=0; i<d; i++)
        {
            doubleTuple.set(i, longTuple.get(i));
        }
        return doubleTuple;
    }
1196767
public static <X, Y, Z> Triple<X, Y, Z> makeTriple(X x, Y y, Z z) {
    return new Triple<X, Y, Z>(x, y, z);
  }
94699
public static <V> MultipleObjectsBundle makeSimple(SimpleTypeInformation<? super V> type, List<? extends V> data) {
    MultipleObjectsBundle bundle = new MultipleObjectsBundle();
    bundle.appendColumn(type, data);
    return bundle;
  }
69937
public static <T> SameType<T> of(TreeNode<T> expected, TreeNode<T> actual) {
		return of(TreeNode.treeDef(), expected, TreeNode.treeDef(), actual).mapToSame(TreeNode::getContent, TreeNode::getContent);
	}
48004
function T(iid, val, type, hasGetterSetter, internalIid) {
        var aret;
        associateSidWithFunction(val, internalIid);
        if (hasGetterSetter) {
            for (var offset in val) {
                if (hasGetOwnPropertyDescriptor && val.hasOwnProperty(offset)) {
                    var desc = Object.getOwnPropertyDescriptor(val, offset);
                    if (desc !== undefined) {
                        if (typeof desc.get === 'function') {
                            T(iid, desc.get, 12, false, internalIid);
                        }
                        if (typeof desc.set === 'function') {
                            T(iid, desc.set, 12, false, internalIid);
                        }
                    }
                }
            }
        }
        if (sandbox.analysis && sandbox.analysis.literal) {
            aret = sandbox.analysis.literal(iid, val, hasGetterSetter);
            if (aret) {
                val = aret.result;
            }
        }
        return (lastComputedValue = val);
    }
280587
public static <T, U> Predicate<Pair<T, U>> tupled(BiPredicate<T, U> predicate) {
        dbc.precondition(predicate != null, "cannot apply a pair to a null predicate");
        return pair -> predicate.test(pair.first(), pair.second());
    }
1235908
public static Point3i convert(Tuple3D<?> tuple) {
		if (tuple instanceof Point3i) {
			return (Point3i) tuple;
		}
		return new Point3i(tuple.getX(), tuple.getY(), tuple.getZ());
	}
991142
public static Vector3ifx convert(Tuple3D<?> tuple) {
		if (tuple instanceof Vector3ifx) {
			return (Vector3ifx) tuple;
		}
		return new Vector3ifx(tuple.getX(), tuple.getY(), tuple.getZ());
	}
395770
def from_triples(cls, triples, remap_nodeids=True):
        
        top_nid = str(LTOP_NODEID)
        top = lnk = surface = identifier = None
        nids, nd, edges = [], {}, []
        for src, rel, tgt in triples:
            src, tgt = str(src), str(tgt)  # hack for int-converted src/tgt
            if src == top_nid and rel == 'top':
                top = tgt
                continue
            elif src not in nd:
                if top is None:
                    top=src
                nids.append(src)
                nd[src] = {'pred': None, 'lnk': None, 'carg': None, 'si': []}
            if rel == 'predicate':
                nd[src]['pred'] = Pred.surface_or_abstract(tgt)
            elif rel == 'lnk':
                cfrom, cto = tgt.strip('"<>').split(':')
                nd[src]['lnk'] = Lnk.charspan(int(cfrom), int(cto))
            elif rel == 'carg':
                if (tgt[0], tgt[-1]) == ('"', '"'):
                    tgt = tgt[1:-1]
                nd[src]['carg'] = tgt
            elif rel.islower():
                nd[src]['si'].append((rel, tgt))
            else:
                rargname, post = rel.rsplit('-', 1)
                edges.append((src, tgt, rargname, post))
        if remap_nodeids:
            nidmap = dict((nid, FIRST_NODEID+i) for i, nid in enumerate(nids))
        else:
            nidmap = dict((nid, nid) for nid in nids)
        nodes = [
            Node(
                nodeid=nidmap[nid],
                pred=nd[nid]['pred'],
                sortinfo=nd[nid]['si'],
                lnk=nd[nid]['lnk'],
                carg=nd[nid]['carg']
            ) for i, nid in enumerate(nids)
        ]
        links = [Link(nidmap[s], nidmap[t], r, p) for s, t, r, p in edges]
        if top:
            links.append(Link(LTOP_NODEID, nidmap[top], None, H_POST))
        return cls(
            nodes=nodes,
            links=links,
            lnk=lnk,
            surface=surface,
            identifier=identifier
        )
1149485
public static <T extends Transform> T multiply (
        double m00, double m01, double m10, double m11, double tx, double ty, AffineTransform b, T into) {
        return multiply(m00, m01, m10, m11, tx, ty, b.m00, b.m01, b.m10, b.m11, b.tx, b.ty, into);
    }
994183
def duplicate(self, template_fact, **modifiers):
        """"""

        newfact = template_fact.copy()
        newfact.update(dict(self._get_real_modifiers(**modifiers)))

        return self.declare(newfact)
1183896
public static <T extends Transform> T multiply (
        AffineTransform a, double m00, double m01, double m10, double m11, double tx, double ty, T into) {
        return multiply(a.m00, a.m01, a.m10, a.m11, a.tx, a.ty, m00, m01, m10, m11, tx, ty, into);
    }
121285
public <U extends T, A, B, C> InitialMatching3<T, U, A, B, C> when(
      DecomposableMatchBuilder3<U, A, B, C> decomposableMatchBuilder) {
    return new InitialMatching3<>(decomposableMatchBuilder.build(), value);
  }
772762
private SQLPPTriplesMap getMapping(TriplesMap tm) throws Exception {
		String sourceQuery = r2rmlParser.getSQLQuery(tm).trim();
		ImmutableList<TargetAtom> body = getMappingTripleAtoms(tm);
		//Function head = getHeadAtom(body);
		//CQIE targetQuery = DATALOG_FACTORY.getCQIE(head, body);
		// TODO: consider a R2RML-specific type of triples map
		SQLPPTriplesMap mapping = new OntopNativeSQLPPTriplesMap("mapping-"+tm.hashCode(),
				MAPPING_FACTORY.getSQLQuery(sourceQuery), body);
        if (body.isEmpty()){
            //we do not have a target query
            System.out.println("WARNING a mapping without target query will not be introduced : "+ mapping.toString());
            return null;
        }
		return mapping;
	}
1239782
public static TypePredicate isExactTypeAny(Iterable<String> types) {
    return new ExactAny(Iterables.transform(types, GET_TYPE));
  }