Examples of TNodes


Examples of org.apache.marmotta.platform.sparql.model.tables.TNodes

        // type negotiation:
        // 1. if both are variables, casting should take place based on the type field, or if no type is given, we use
        // the value returned by getValue (might be the URI)
        if(leftArg instanceof TNodes && rightArg instanceof TNodes) {
            TNodes tleft  = (TNodes) leftArg;
            TNodes tright = (TNodes) rightArg;

            switch (node.getOperator()) {
                case EQ:
                    return create.decode().when(tleft.NODETYPE.equal("DOUBLE").and(tright.NODETYPE.equal("DOUBLE")), tleft.DOUBLECONTENT.equal(tright.DOUBLECONTENT))
                            .when(tleft.NODETYPE.equal("INTEGER").and(tright.NODETYPE.equal("INTEGER")), tleft.INTCONTENT.equal(tright.INTCONTENT))
View Full Code Here

Examples of org.apache.marmotta.platform.sparql.model.tables.TNodes

        if(groupBy.size() > 0) {
            for(String group : groupBy) {
                Field variable = extensions.get(group.replace("-","_"));
                if(variable == null) {
                    TNodes table = getVariable(group);
                    if(table != null) {
                        query.addGroupBy(table.ID);
                        query.addGroupBy(table.URI);
                        query.addGroupBy(table.ANONID);
                        query.addGroupBy(table.CONTENT);
View Full Code Here

Examples of org.apache.marmotta.platform.sparql.model.tables.TNodes

    }


    public void projectionElem(ProjectionElem node, SelectQuery query)  {
        // renaming needs to take place in the result construction!
        TNodes var = getVariable(node.getSourceName());

        // if var is null, then we have an extension
        if(var != null) {
            query.addSelect(var.ID.as(node.getTargetName())); // just the ID for now, we will use Hibernate to load the complete node
            projectedVariables.add(node.getTargetName());
View Full Code Here

Examples of org.apache.marmotta.platform.sparql.model.tables.TNodes

        TTriples triple = T_TRIPLES.as(name);
        JoinTable j_triple = new JoinTable(triple);
        j_triple.addCondition(triple.DELETED.isFalse());
        tables.add(triple);

        TNodes t_subject = null, t_property = null, t_object = null, t_context = null;
        JoinTable j_subject = null, j_property = null, j_object = null, j_context = null;

        List<JoinTable> resultTables = new ArrayList<JoinTable>();

View Full Code Here

Examples of org.apache.marmotta.platform.sparql.model.tables.TNodes

     * @return
     */
    protected Field getValue(QueryPart part, boolean typeCasting) {

        if(part instanceof TNodes) {
            TNodes table = (TNodes)part;

            if(typeCasting && !resourceVariables.contains(table.getName())) {
                return create.coalesce(table.CONTENT, table.URI, table.ANONID);
            } else if(resourceVariables.contains(table.getName())) {
                return table.URI;
            } else {
                return table.CONTENT;
            }
        } else if(part instanceof Field) {
View Full Code Here

Examples of org.apache.marmotta.platform.sparql.model.tables.TNodes

        }
    }

    protected Field<Double> getDoubleValue(QueryPart part, boolean typeCasting) {
        if(part instanceof TNodes) {
            TNodes table = (TNodes)part;

            if(typeCasting) {
                return create.coalesce(table.DOUBLECONTENT,table.INTCONTENT.cast(SQLDataType.DOUBLE),table.CONTENT.cast(SQLDataType.DOUBLE));
            } else {
                return table.DOUBLECONTENT;
View Full Code Here

Examples of org.apache.marmotta.platform.sparql.model.tables.TNodes

        }
    }

    protected Field<Long> getIntegerValue(QueryPart part, boolean typeCasting) {
        if(part instanceof TNodes) {
            TNodes table = (TNodes)part;
            if(typeCasting) {
                return create.coalesce(table.INTCONTENT,table.DOUBLECONTENT.cast(SQLDataType.BIGINT),table.CONTENT.cast(SQLDataType.BIGINT));
            } else {
                return table.INTCONTENT;
            }
View Full Code Here

Examples of org.apache.marmotta.platform.sparql.model.tables.TNodes

        }
    }

    protected Field<Timestamp> getDateValue(QueryPart part, boolean typeCasting) {
        if(part instanceof TNodes) {
            TNodes table = (TNodes)part;

            if(typeCasting) {
                return create.coalesce(table.DATECONTENT,table.CONTENT.cast(SQLDataType.TIMESTAMP));
            } else {
                return ((TNodes) part).DATECONTENT;
View Full Code Here

Examples of org.apache.marmotta.platform.sparql.model.tables.TNodes

     * @param stringOnly
     * @return
     */
    protected Set<Field> getAlternativeValues(QueryPart part, boolean stringOnly) {
        if(part instanceof TNodes) {
            TNodes table = (TNodes)part;

            HashSet<Field> result = new HashSet<Field>();
            result.add(table.URI);
            result.add(table.CONTENT);
            if(!stringOnly) {
View Full Code Here

Examples of org.apache.marmotta.platform.sparql.model.tables.TNodes

    protected TNodes getVariable(String name) {
        return variables.get(name);
    }

    protected TNodes createVariable(String name) {
        TNodes variable = getVariable(name);
        if(variable == null) {
            variable = T_NODES.as(getNodeName(name));
            variables.put(name,variable);
        }
        return variable;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.