Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test(uri_or_path, noverbose, trylist):
l = RDFLoader(verbose=not (noverbose))
if trylist or not uri_or_path:
l.load(["http://purl.org/dc/terms/", "http://xmlns.com/foaf/spec/"])
else:
l.load(uri_or_path)
def load_rdf(self,
uri_or_path=None,
data=None,
file_obj=None,
rdf_format="",
verbose=False,
hide_base_schemas=True,
hide_implicit_types=True,
hide_implicit_preds=True):
"""Load an RDF source into an ontospy/rdflib graph"""
loader = RDFLoader(verbose=verbose)
loader.load(uri_or_path, data, file_obj, rdf_format)
self.rdflib_graph = loader.rdflib_graph
self.sources = loader.sources_valid
self.sparqlHelper = SparqlHelper(self.rdflib_graph)
self.namespaces = sorted(self.rdflib_graph.namespaces())
def __init__(self, rdfgraph=None, verbose=False):
super(RDFLoader, self).__init__()
self.rdflib_graph = rdfgraph or rdflib.Graph()
self.sources_valid = []
self.sources_invalid = []
self.verbose = verbose