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);
}
}
Aggregations