Skip to content

Commit

Permalink
fix: do not include non-standard ex prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
jenspots committed Apr 5, 2024
1 parent 69965af commit c55bf94
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ Turtle prefixes are hard coded for the time being. Ideally, these should be base

```ts
const prefixes = new PrefixMapFactory().prefixMap();
prefixes.set("ex", rdf.namedNode("http://example.org#"));
prefixes.set("sh", rdf.namedNode("http://www.w3.org/ns/shacl#"));
```
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export async function validate(

// Initialize the shared serializer.
const prefixes = new PrefixMapFactory().prefixMap();
prefixes.set("ex", rdf.namedNode("http://example.org#"));
prefixes.set("sh", rdf.namedNode("http://www.w3.org/ns/shacl#"));
const serializer = new Serializer({ prefixes });
const parser = rdf.formats.parsers.get("text/turtle")!;
Expand Down
15 changes: 7 additions & 8 deletions tests/data/invalid.report.ttl
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
@prefix ex: <http://example.org#>.
@prefix sh: <http://www.w3.org/ns/shacl#>.

[ a sh:ValidationReport;
sh:conforms false;
sh:result [ a sh:ValidationResult;
sh:focusNode ex:ValidPoint;
sh:focusNode <http://example.org#ValidPoint>;
sh:resultMessage "Requires an integer Y coordinate";
sh:resultPath ex:y;
sh:resultPath <http://example.org#y>;
sh:resultSeverity sh:Violation;
sh:sourceConstraintComponent sh:DatatypeConstraintComponent;
sh:sourceShape [];
sh:value "2"
], [ a sh:ValidationResult;
sh:focusNode ex:ValidPoint;
sh:focusNode <http://example.org#ValidPoint>;
sh:resultMessage "Predicate is not allowed (closed shape)";
sh:resultPath ex:z;
sh:resultPath <http://example.org#z>;
sh:resultSeverity sh:Violation;
sh:sourceConstraintComponent sh:ClosedConstraintComponent;
sh:sourceShape ex:PointShape;
sh:sourceShape <http://example.org#PointShape>;
sh:value "3"
], [ a sh:ValidationResult;
sh:focusNode ex:ValidPoint;
sh:focusNode <http://example.org#ValidPoint>;
sh:resultMessage "Requires an integer X coordinate";
sh:resultPath ex:x;
sh:resultPath <http://example.org#x>;
sh:resultSeverity sh:Violation;
sh:sourceConstraintComponent sh:DatatypeConstraintComponent;
sh:sourceShape [];
Expand Down

0 comments on commit c55bf94

Please sign in to comment.