-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…-report-from-server GH-1900 Server responds with SHACL validation report if validation failed
- Loading branch information
Showing
27 changed files
with
834 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...ent/src/main/java/org/eclipse/rdf4j/http/client/shacl/RemoteShaclValidationException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 Eclipse RDF4J contributors. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Distribution License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/org/documents/edl-v10.php. | ||
*******************************************************************************/ | ||
|
||
package org.eclipse.rdf4j.http.client.shacl; | ||
|
||
import org.eclipse.rdf4j.RDF4JException; | ||
import org.eclipse.rdf4j.common.annotation.Experimental; | ||
import org.eclipse.rdf4j.exceptions.ValidationException; | ||
import org.eclipse.rdf4j.model.Model; | ||
import org.eclipse.rdf4j.model.vocabulary.SHACL; | ||
import org.eclipse.rdf4j.rio.RDFFormat; | ||
|
||
import java.io.StringReader; | ||
|
||
/** | ||
* Experimental support for handling SHACL violations against a remote RDF4J server. | ||
*/ | ||
@Experimental | ||
public class RemoteShaclValidationException extends RDF4JException implements ValidationException { | ||
|
||
private final RemoteValidation remoteValidation; | ||
|
||
public RemoteShaclValidationException(StringReader stringReader, String s, RDFFormat format) { | ||
remoteValidation = new RemoteValidation(stringReader, s, format); | ||
} | ||
|
||
/** | ||
* @return A Model containing the validation report as specified by the SHACL Recommendation | ||
*/ | ||
@Override | ||
public Model validationReportAsModel() { | ||
Model model = remoteValidation.asModel(); | ||
model.setNamespace(SHACL.PREFIX, SHACL.NAMESPACE); | ||
return model; | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.