@Override public Response toResponse(TypeRenderingException exception) { ResponseBuilder rb = Response.serverError(); logger.info("Rendering: "+exception.getMessage(), exception); if (exception.getRenderNode().hasProperty(RDF.type, TYPERENDERING.Exception)) { logger.error("Exception in template used for rendering exceptions ", exception); rb.entity("There is an error in the template used for rendering" + " exceptions. Please check the console output for further" + " information. Thanks!").type(MediaType.TEXT_PLAIN_TYPE); } else { rb.entity(exception.getExceptionGraphNode()); } return rb.build(); }
private boolean isBaseRole(BlankNodeOrIRI role) { Graph systemGraph = getSystemGraph(); GraphNode roleNode = new GraphNode(role, systemGraph); Lock readLock = roleNode.readLock(); readLock.lock(); try { return roleNode.hasProperty(RDF.type, PERMISSION.BaseRole); } finally { readLock.unlock(); } }
private VirtualProperty asVirtualProperty(GraphNode r, List<VirtualProperty> vPropertyList) { if (r.hasProperty(RDF.type, CRIS.JoinVirtualProperty)) { if (vPropertyList == null) { vPropertyList = new ArrayList<VirtualProperty>(); } return new JoinVirtualProperty(getVirtualPropertyList(r, vPropertyList), r.hasProperty(RDF.type, CRIS.FacetProperty)); } else { if (r.hasProperty(RDF.type, CRIS.PathVirtualProperty)) { return new PathVirtualProperty(getUriPropertyList(r), r.hasProperty(RDF.type, CRIS.FacetProperty)); } else { if ((r.getNode()) instanceof UriRef) { return new PropertyHolder((UriRef) r.getNode(), r.hasProperty(RDF.type, CRIS.FacetProperty)); } else { throw new RuntimeException(r + " is not of a knows VirtualProperty type and its not a UriRef (it's a " + (r.getNode()).getClass() + ")"); } } } }