-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add another check that validates that the context for jsonld
Signed-off-by: Maximilian Huber <[email protected]>
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# SPDX-FileCopyrightText: 2023 spdx contributors | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import sys | ||
from rdflib import Graph | ||
|
||
def parseString(data: str) -> Graph: | ||
return Graph().parse(data=data, format='json-ld') | ||
|
||
def testLocalContext(context_file: str) -> Graph: | ||
data = "{ \"@context\": [ \"" + context_file + "\" ], \"@graph\": [ ] }" | ||
parseString(data) | ||
|
||
|
||
if __name__ == '__main__': | ||
# run testLocalContext with first argument as context file | ||
testLocalContext(sys.argv[1]) |