private void populateDatatype(LocalIndividual constraint, URI datatype) { if(datatype!=null) { constraint.addValue(shaclTerm("datatype"),externalIndividual(datatype)); } }
private void populateValueType(LocalIndividual constraint, URI valueType) { if(valueType!=null) { constraint.addValue(shaclTerm("valueType"),externalIndividual(valueType)); } }
private ExternalIndividual headerType(Header header) { return externalIndividual(httpTerm(HeaderHelper.getHeaderType(header.name()))); }
private void populateNodeKind(Individual<?,?> individual, NodeKind nodeKind) { if(nodeKind!=null) { individual.addValue(shaclTerm("nodeKind"), externalIndividual(shaclTerm(nodeKind.localName()))); } }
addValue( vocabularyTerm(RDF.REST), externalIndividual(RDF.NIL.as(URI.class)));
String shapeId = cache.id(shape); reportInd().addValue(ldp4jTerm("hasShape"), shapeInd); shapeInd.addValue(vocabularyTerm(RDF.TYPE), externalIndividual(shaclTerm("Shape"))); populateDescription(shapeInd, shape); List<PropertyConstraint> pcs = shape.propertyConstraints(); LocalIndividual pcInd = localIndividual(shapeId+"_pc"+j); shapeInd.addValue(shaclTerm("property"), pcInd); pcInd.addValue(vocabularyTerm(RDF.TYPE), externalIndividual(shaclTerm("PropertyConstraint"))); pcInd.addValue(shaclTerm("predicate"), externalIndividual(pc.predicate())); populateDescription(pcInd, pc); populateCardinality(pcInd, pc.cardinality()); LocalIndividual ipcInd = localIndividual(shapeId+"_ipc"+j); shapeInd.addValue(shaclTerm("property"), ipcInd); ipcInd.addValue(vocabularyTerm(RDF.TYPE), externalIndividual(shaclTerm("InversePropertyConstraint"))); ipcInd.addValue(shaclTerm("predicate"), externalIndividual(ipc.predicate())); populateDescription(ipcInd, ipc); populateCardinality(ipcInd, ipc.cardinality());
private void populateConstraintReportIndividual() { Constraints constraints = this.report.getConstraints(); LOGGER.debug("Populating constraints: {}",constraints); reportInd().addValue(vocabularyTerm(RDF.TYPE), externalIndividual(ldp4jTerm("ConstraintReport"))); reportInd().addValue(ldp4jTerm("failureId"), literal(this.report.id().failureId())); reportInd().addValue(ldp4jTerm("failureDate"), literal(this.report.getDate())); reportInd().addValue(ldp4jTerm("failureRequest"), requestInd()); IndividualTranslator translator = new IndividualTranslator(); ShapeIndividualCache shapeCache=new ShapeIndividualCache(); Queue<Shape> pendingShapes=Lists.newLinkedList(constraints.shapes()); while(!pendingShapes.isEmpty()) { Shape shape=pendingShapes.poll(); if(!shapeCache.isPopulated(shape)) { shapeCache.populate(shape); Set<Shape> foundShapes = populateShapeDefinition(shape, shapeCache, translator); pendingShapes.addAll(foundShapes); } } for(URI type:constraints.types()) { Individual<?,?> typeInd=externalIndividual(type); typeInd.addValue(shaclTerm("typeShape"), shapeCache.individual(constraints.typeShape(type))); } for(Individual<?, ?> node:constraints.nodes(dataset)) { Individual<?, ?> individual = translator.translate(node); individual.addValue(shaclTerm("nodeShape"), shapeCache.individual(constraints.nodeShape(node))); } }
private void populateHttpRequestIndividual(HttpRequest request) { requestInd().addValue(vocabularyTerm(RDF.TYPE), externalIndividual(httpTerm("Request"))); requestInd().addValue(httpTerm("methodName"),literal(request.method().toString())); requestInd().addValue(httpTerm("mthd"),externalIndividual(methodsTerm(request.method().toString()))); requestInd().addValue(httpTerm("absolutePath"),literal(request.absolutePath())); String protocolVersion="1.1"; headerInd.addValue(httpTerm("fieldName"),literal(header.name())); headerInd.addValue(httpTerm("fieldValue"),literal(header.rawValue())); headerInd.addValue(httpTerm("hdrName"),externalIndividual(headersTerm(header.name()))); i++; if(headers.hasNext()) { last.addValue(vocabularyTerm(RDF.REST),current); } else { current.addValue(vocabularyTerm(RDF.REST),externalIndividual(RDF.NIL.as(URI.class))); LocalIndividual bodyInd=localIndividual("body"); requestInd().addValue(httpTerm("body"), bodyInd); bodyInd.addValue(vocabularyTerm(RDF.TYPE),externalIndividual(cntTerm("ContentAsText")));