Skip to content

Commit

Permalink
implement objectUriBlacklist check
Browse files Browse the repository at this point in the history
  • Loading branch information
musicog committed Sep 3, 2018
1 parent 98e29e8 commit 8372967
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,16 @@ export function traverse(
// Now recurse (if black/whitelist conditions and hop counter allow)
// Remember that we've already visited the current document to avoid loops
if( numHops !== 0 && !(objectUriBlacklist.includes(obj["@id"])) ) {
dispatch(traverse(obj["@id"], {
...params,
"objectUriBlacklist": objectUriBlacklist.concat(docUri),
"numHops": numHops-1
}))
const badPrefixMatches = objectPrefixBlacklist.filter((b) => {
return obj["@id"].startsWith(b)
})
if(badPrefixMatches.length === 0) {
dispatch(traverse(obj["@id"], {
...params,
"objectUriBlacklist": objectUriBlacklist.concat(docUri),
"numHops": numHops-1
}))
}
}
} else {
// our *RDF* object is a literal
Expand Down

0 comments on commit 8372967

Please sign in to comment.