Search in sources :

Example 1 with ShexMap

use of org.apache.jena.shex.ShexMap in project jena by apache.

the class ShExC method parseShapeMap$.

private static ShexMap parseShapeMap$(ShExJavacc parser, String baseURI, Context context) {
    ParserProfile profile = new ParserProfileStd(RiotLib.factoryRDF(), ErrorHandlerFactory.errorHandlerStd, IRIxResolver.create(baseURI).build(), PrefixMapFactory.create(), context, false, false);
    // addStandardPrefixes(profile.getPrefixMap());
    parser.setProfile(profile);
    // We don't use the StreamRDF.
    parser.setDest(StreamRDFLib.sinkNull());
    try {
        parser.parseShapeMapStart();
        parser.UnitShapeMap();
        ShexMap map = parser.parseShapeMapFinish();
        return map;
    } catch (ParseException ex) {
        throw new ShexParseException(ex.getMessage(), ex.currentToken.beginLine, ex.currentToken.beginColumn);
    } catch (TokenMgrError tErr) {
        int col = parser.token.endColumn;
        int line = parser.token.endLine;
        throw new ShexParseException(tErr.getMessage(), line, col);
    }
}
Also used : ShexMap(org.apache.jena.shex.ShexMap) TokenMgrError(org.apache.jena.shex.parser.javacc.TokenMgrError) ParseException(org.apache.jena.shex.parser.javacc.ParseException)

Aggregations

ShexMap (org.apache.jena.shex.ShexMap)1 ParseException (org.apache.jena.shex.parser.javacc.ParseException)1 TokenMgrError (org.apache.jena.shex.parser.javacc.TokenMgrError)1