Skip to content

Commit

Permalink
feat: filter of CSVW triples
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Aug 14, 2023
1 parent d5aa006 commit c7c922d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/silent-chicken-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"barnard59-csvw": patch
---

Added module with a commonly used CSVW filter
13 changes: 13 additions & 0 deletions packages/csvw/filter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import rdf from '@zazuko/env'

export function excludeCsvwTriples(quad) {
if (quad.predicate.value.startsWith(rdf.ns.csvw('').value)) {
return false
}

if (rdf.ns.rdf.type.equals(quad.predicate) && quad.object.value.startsWith(rdf.ns.csvw('').value)) {
return false
}

return true
}

0 comments on commit c7c922d

Please sign in to comment.