Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion archivo/utils/async_rdf_retrieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

def chunk_list(lst, size):
for i in range(0, len(lst), size):
yield lst[i : i + size]
yield lst[i: i + size]


async def fetch_one_nt_resource(
Expand Down
20 changes: 20 additions & 0 deletions archivo/utils/inspectVocabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def getGraphOfVocabFile(filepath, logger=None):


def get_graph_of_string(rdf_string, content_type):

if rdf_string is None:
return None
graph = rdflib.Graph()
graph.parse(data=rdf_string, format=header_rdflib_mapping.get(content_type, "xml"))
return graph
Expand Down Expand Up @@ -406,7 +409,24 @@ def hackyShaclInspection(shaclURL):
return "OK"


def inspect_shacl_string(shaclString):

if shaclString is None:
return None

if "sh:resultSeverity sh:Violation" in shaclString:
return "VIOLATION"
elif "sh:resultSeverity sh:Warning" in shaclString:
return "WARNING"
elif "sh:resultSeverity sh:Info" in shaclString:
return "INFO"
else:
return "OK"


def interpretShaclGraph(graph):
if graph is None:
return None
violationRef = URIRef("http://www.w3.org/ns/shacl#Violation")
warningRef = URIRef("http://www.w3.org/ns/shacl#Warning")
infoRef = URIRef("http://www.w3.org/ns/shacl#Info")
Expand Down
Loading