Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
###print "key: "+repr(k)
if not isinstance(k,rdflib.BNode):
simplebinding[str(k)] = str(binding[k])
if str(k) in ['if', 'of'] and str(binding[k])[:5] != "file:":
# Houston, we have a problem...
agraph = rometa.roannotations
print "--------------------"
print "Graph: "+agraph.serialize(format="xml")
print "Query: "+query
print "Response bindings: "+repr(resp)
print "--------------------"
assert False, "Aborted"
# Construct URI for file from template
# Uses code copied from http://code.google.com/p/uri-templates
template = rule['template']
fileref = uritemplate.expand(rule['template'], simplebinding)
fileuri = rometa.getComponentUri(fileref)
###print "forall test: binding %s"%(repr(simplebinding))
###print "...........: template %s, fileref %s"%(template, fileref)
###print "...........: fileuri %s"%(repr(fileuri))
###print "...........: RO uri %s"%(repr(rometa.getRoUri()))
# Test if URI is aggregated
satisfied = rometa.roManifestContains( (rometa.getRoUri(), ORE.aggregates, fileuri) )
###print "...........: satisfied %s"%(satisfied)
if not satisfied: break
else:
raise ValueError("Unrecognized content match rule: %s"%repr(rule))
return satisfied
def expand_uri_template(request):
tp = request.json_body
uri = uritemplate.expand(tp['template'], tp['params'])
return Response(uri+"\n", content_type="text/plain")