Package org.jrdf.sparql.parser.parser

Examples of org.jrdf.sparql.parser.parser.ParserException


        Map<AttributeName, PositionalNodeType> variables = varCollector.getAttributes();
        for (AttributeName variable : declaredVariables) {
            NodeType type = variables.get(variable);
            if (type == null) {
                String literal = variable.getLiteral();
                throw new ParserException(new TIdentifier(literal), "Failed to find variable " +
                    literal + " in where clause. ");
            } else {
                Attribute attribute = new AttributeImpl(variable, type);
                newAttributes.add(attribute);
            }
View Full Code Here


    private void createFromURIReference(Token node, URI uri)  {
        try {
            uriRef = factory.createURIReference(uri);
        } catch (GraphElementFactoryException e) {
            exception = new ParserException(node,
                "Cannot create URI reference for URI: " + uri.toString());
        }
    }
View Full Code Here

        return variable.getVariablename().getText();
    }

    private Node createQNameResource(String identifier, String ncName) {
        if (!prefixMap.keySet().contains(identifier)) {
            exception = new ParserException(new TIdentifier("identifier"), "Couldn't find prefix: " + identifier);
            return null;
        } else {
            String stringForm = prefixMap.get(identifier) + ncName;
            return createResource(create(stringForm));
        }
View Full Code Here

    private URIReference createResource(URI uri) {
        try {
            return currentGraph.getElementFactory().createURIReference(uri);
        } catch (GraphElementFactoryException e) {
            exception = new ParserException(new TIdentifier("identifier"), "Couldn't create URI: " + uri);
            return null;
        }
    }
View Full Code Here

    @Override
    public void caseAQnameDatatypeDatatype(AQnameDatatypeDatatype node) {
        AQnameQnameElement qname = (AQnameQnameElement) node.getQnameElement();
        String prefix = qname.getNcnamePrefix().getText();
        if (!prefixMap.keySet().contains(prefix)) {
            exception = new ParserException(qname.getNcnamePrefix(), "Prefix not found: " + prefix);
        } else {
            uri = create(prefixMap.get(prefix) + qname.getNcName().getText());
        }
    }
View Full Code Here

    private void createLiteral(String s) {
        try {
            result = factory.createLiteral(s);
        } catch (GraphElementFactoryException e) {
            exception = new ParserException(currentToken, "Could not create literal: " + s);
        }
    }
View Full Code Here

    private void createLiteral(String s, String language) {
        try {
            result = factory.createLiteral(s, language);
        } catch (GraphElementFactoryException e) {
            exception = new ParserException(currentToken, "Could not create literal: " + s + " lang: " + language);
        }
    }
View Full Code Here

    private void createLiteral(String s, URI datatype) {
        try {
            result = factory.createLiteral(s, datatype);
        } catch (GraphElementFactoryException e) {
            exception = new ParserException(currentToken, "Could not create literal: " + s + " datatype: " + datatype);
        }
    }
View Full Code Here

TOP

Related Classes of org.jrdf.sparql.parser.parser.ParserException

Copyright © 2018 www.massapicom. 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.