Examples of KiWiNode


Examples of org.apache.marmotta.kiwi.model.rdf.KiWiNode

        QueryResult match = new QueryResult();

        if(pattern.getSubject().isResourceField()) {
            result = ((ResourceField)pattern.getSubject()).getResource().equals(triple.getSubject());
        } else if(pattern.getSubject().isVariableField()) {
            KiWiNode binding = match.getBindings().get(pattern.getSubject());
            if(binding != null) {
                result = binding.equals(triple.getSubject());
            } else {
                match.getBindings().put((VariableField) pattern.getSubject(), triple.getSubject());
            }
        }

        if(result && pattern.getProperty().isResourceField()) {
            result = ((ResourceField)pattern.getProperty()).getResource().equals(triple.getPredicate());
        } else if(result && pattern.getProperty().isVariableField()) {
            KiWiNode binding = match.getBindings().get(pattern.getProperty());
            if(binding != null) {
                result = binding.equals(triple.getPredicate());
            } else {
                match.getBindings().put((VariableField) pattern.getProperty(), triple.getPredicate());
            }
        }

        if(result && pattern.getContext() != null && pattern.getContext().isResourceField()) {
            result = ((ResourceField)pattern.getContext()).getResource().equals(triple.getContext());
        } else if(result && pattern.getContext() != null && pattern.getContext().isVariableField()) {
            KiWiNode binding = match.getBindings().get(pattern.getContext());
            if(binding != null) {
                result = binding.equals(triple.getContext());
            } else {
                match.getBindings().put((VariableField) pattern.getContext(), triple.getContext());
            }
        }

        if(result && pattern.getObject().isResourceField()) {
            result = ((ResourceField)pattern.getObject()).getResource().equals(triple.getObject());
        } else if(result && pattern.getObject().isLiteralField()) {
            result = ((LiteralField)pattern.getObject()).getLiteral().equals(triple.getObject());
        } else if(result && pattern.getObject().isVariableField()) {
            KiWiNode binding = match.getBindings().get(pattern.getObject());
            if(binding != null) {
                result = binding.equals(triple.getObject());
            } else {
                match.getBindings().put((VariableField) pattern.getObject(), triple.getObject());
            }
        }
View Full Code Here

Examples of org.apache.marmotta.kiwi.model.rdf.KiWiNode

                contextSet.add(valueFactory.createURI(inferredContext));
            }

            KiWiResource    ksubj = valueFactory.convert(subj);
            KiWiUriResource kpred = valueFactory.convert(pred);
            KiWiNode        kobj  = valueFactory.convert(obj);


            Set<KiWiTriple> added = new HashSet<KiWiTriple>();
            for(Resource context : contextSet) {
                KiWiResource kcontext = valueFactory.convert(context);
View Full Code Here

Examples of org.apache.marmotta.kiwi.model.rdf.KiWiNode

    @Override
    protected CloseableIteration<? extends Statement, SailException> getStatementsInternal(Resource subj, URI pred, Value obj, final boolean includeInferred, Resource... contexts) throws SailException {
        final KiWiResource rsubj    = valueFactory.convert(subj);
        final KiWiUriResource rpred = valueFactory.convert(pred);
        final KiWiNode robj         = valueFactory.convert(obj);

        Set<KiWiResource> contextSet = new HashSet<KiWiResource>();
        contextSet.addAll(Lists.transform(Arrays.asList(contexts), new Function<Resource, KiWiResource>() {
            @Override
            public KiWiResource apply(Resource input) {
View Full Code Here

Examples of org.apache.marmotta.kiwi.model.rdf.KiWiNode

        if(initialBindings != null) {
            for(VariableField v : initialBindings.getBindings().keySet()) {
                List<String> vNames = queryVariables.get(v);
                if(vNames != null && vNames.size() > 0) {
                    String vName = vNames.get(0);
                    KiWiNode binding = initialBindings.getBindings().get(v);
                    whereConditions.add(vName+".id = "+binding.getId());
                }
            }
        }

        // 4. for each pattern, ensure that the matched triple is not marked as deleted
View Full Code Here

Examples of org.apache.marmotta.kiwi.model.rdf.KiWiNode

        if(initialBindings != null) {
            for(VariableField v : initialBindings.getBindings().keySet()) {
                List<String> vNames = queryVariables.get(v);
                if(vNames != null && vNames.size() > 0) {
                    String vName = vNames.get(0);
                    KiWiNode binding = initialBindings.getBindings().get(v);
                    whereConditions.add(vName+".id = "+binding.getId());
                }
            }
        }

        // 4. for each pattern, ensure that the matched triple is not marked as deleted
View Full Code Here

Examples of org.apache.marmotta.kiwi.model.rdf.KiWiNode

        QueryResult match = new QueryResult();

        if(pattern.getSubject().isResourceField()) {
            result = ((ResourceField)pattern.getSubject()).getResource().equals(triple.getSubject());
        } else if(pattern.getSubject().isVariableField()) {
            KiWiNode binding = match.getBindings().get(pattern.getSubject());
            if(binding != null) {
                result = binding.equals(triple.getSubject());
            } else {
                match.getBindings().put((VariableField) pattern.getSubject(), triple.getSubject());
            }
        }

        if(result && pattern.getProperty().isResourceField()) {
            result = ((ResourceField)pattern.getProperty()).getResource().equals(triple.getPredicate());
        } else if(result && pattern.getProperty().isVariableField()) {
            KiWiNode binding = match.getBindings().get(pattern.getProperty());
            if(binding != null) {
                result = binding.equals(triple.getPredicate());
            } else {
                match.getBindings().put((VariableField) pattern.getProperty(), triple.getPredicate());
            }
        }

        if(result && pattern.getContext() != null && pattern.getContext().isResourceField()) {
            result = ((ResourceField)pattern.getContext()).getResource().equals(triple.getContext());
        } else if(result && pattern.getContext() != null && pattern.getContext().isVariableField()) {
            KiWiNode binding = match.getBindings().get(pattern.getContext());
            if(binding != null) {
                result = binding.equals(triple.getContext());
            } else {
                match.getBindings().put((VariableField) pattern.getContext(), triple.getContext());
            }
        }

        if(result && pattern.getObject().isResourceField()) {
            result = ((ResourceField)pattern.getObject()).getResource().equals(triple.getObject());
        } else if(result && pattern.getObject().isLiteralField()) {
            result = ((LiteralField)pattern.getObject()).getLiteral().equals(triple.getObject());
        } else if(result && pattern.getObject().isVariableField()) {
            KiWiNode binding = match.getBindings().get(pattern.getObject());
            if(binding != null) {
                result = binding.equals(triple.getObject());
            } else {
                match.getBindings().put((VariableField) pattern.getObject(), triple.getObject());
            }
        }
View Full Code Here

Examples of org.apache.marmotta.kiwi.model.rdf.KiWiNode

    @Override
    public CloseableIteration<? extends Statement, SailException> getStatements(Resource subj, URI pred, Value obj, final boolean includeInferred, Resource... contexts) throws SailException {
        final KiWiResource rsubj    = valueFactory.convert(subj);
        final KiWiUriResource rpred = valueFactory.convert(pred);
        final KiWiNode robj         = valueFactory.convert(obj);

        Set<KiWiResource> contextSet = new HashSet<KiWiResource>();
        contextSet.addAll(Lists.transform(Arrays.asList(contexts), new Function<Resource, KiWiResource>() {
            @Override
            public KiWiResource apply(Resource input) {
View Full Code Here

Examples of org.apache.marmotta.kiwi.model.rdf.KiWiNode

                contextSet.add(valueFactory.createURI(defaultContext));
            }

            KiWiResource    ksubj = valueFactory.convert(subj);
            KiWiUriResource kpred = valueFactory.convert(pred);
            KiWiNode        kobj  = valueFactory.convert(obj);


            Set<KiWiTriple> added = new HashSet<KiWiTriple>();
            for(Resource context : contextSet) {
                KiWiResource kcontext = valueFactory.convert(context);
View Full Code Here

Examples of org.apache.marmotta.kiwi.model.rdf.KiWiNode

    @Override
    protected CloseableIteration<? extends Statement, SailException> getStatementsInternal(Resource subj, URI pred, Value obj, final boolean includeInferred, Resource... contexts) throws SailException {
        final KiWiResource rsubj    = valueFactory.convert(subj);
        final KiWiUriResource rpred = valueFactory.convert(pred);
        final KiWiNode robj         = valueFactory.convert(obj);

        Set<KiWiResource> contextSet = new HashSet<KiWiResource>();
        contextSet.addAll(Lists.transform(Arrays.asList(contexts), new Function<Resource, KiWiResource>() {
            @Override
            public KiWiResource apply(Resource input) {
View Full Code Here

Examples of org.apache.marmotta.kiwi.model.rdf.KiWiNode

        QueryResult match = new QueryResult();

        if(pattern.getSubject().isResourceField()) {
            result = ((ResourceField)pattern.getSubject()).getResource().equals(triple.getSubject());
        } else if(pattern.getSubject().isVariableField()) {
            KiWiNode binding = match.getBindings().get(pattern.getSubject());
            if(binding != null) {
                result = binding.equals(triple.getSubject());
            } else {
                match.getBindings().put((VariableField) pattern.getSubject(), triple.getSubject());
            }
        }

        if(result && pattern.getProperty().isResourceField()) {
            result = ((ResourceField)pattern.getProperty()).getResource().equals(triple.getPredicate());
        } else if(result && pattern.getProperty().isVariableField()) {
            KiWiNode binding = match.getBindings().get(pattern.getProperty());
            if(binding != null) {
                result = binding.equals(triple.getPredicate());
            } else {
                match.getBindings().put((VariableField) pattern.getProperty(), triple.getPredicate());
            }
        }

        if(result && pattern.getContext() != null && pattern.getContext().isResourceField()) {
            result = ((ResourceField)pattern.getContext()).getResource().equals(triple.getContext());
        } else if(result && pattern.getContext() != null && pattern.getContext().isVariableField()) {
            KiWiNode binding = match.getBindings().get(pattern.getContext());
            if(binding != null) {
                result = binding.equals(triple.getContext());
            } else {
                match.getBindings().put((VariableField) pattern.getContext(), triple.getContext());
            }
        }

        if(result && pattern.getObject().isResourceField()) {
            result = ((ResourceField)pattern.getObject()).getResource().equals(triple.getObject());
        } else if(result && pattern.getObject().isLiteralField()) {
            result = ((LiteralField)pattern.getObject()).getLiteral().equals(triple.getObject());
        } else if(result && pattern.getObject().isVariableField()) {
            KiWiNode binding = match.getBindings().get(pattern.getObject());
            if(binding != null) {
                result = binding.equals(triple.getObject());
            } else {
                match.getBindings().put((VariableField) pattern.getObject(), triple.getObject());
            }
        }
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.