load_string_into_model(model, 'rdfa', response.content)
errmsgs = list(inference.run_validation())
- self.assertEqual(len(errmsgs), 2)
- for errmsg in errmsgs:
- self.assertEqual(errmsg, 'Missing type for: http://localhost/')
+ self.assertEqual(len(errmsgs), 0)
def test_lane_with_rdf_validation(self):
from htsworkflow.util.rdfhelp import add_default_schemas, \
load_string_into_model(model, 'rdfa', response.content)
errmsgs = list(inference.run_validation())
- self.assertEqual(len(errmsgs), 2)
- for errmsg in errmsgs:
- self.assertEqual(errmsg, 'Missing type for: http://localhost/')
+ self.assertEqual(len(errmsgs), 0)
from htsworkflow.util.rdfinfer import Infer
add_default_schemas(model)
inference = Infer(model)
- ignored = {'Missing type for: http://localhost/'}
- errmsgs = [msg for msg in inference.run_validation()
- if msg not in ignored ]
+ errmsgs = list(inference.run_validation())
self.assertEqual(len(errmsgs), 0)
def test_library_index_rdfa(self):
self.assertEqual(response.status_code, 200)
load_string_into_model(model, 'rdfa', response.content)
- ignored = {'Missing type for: http://localhost/'}
- errmsgs = [msg for msg in inference.run_validation()
- if msg not in ignored ]
+ errmsgs = list(inference.run_validation())
self.assertEqual(len(errmsgs), 0)
body = """prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
?species libns:species_name ?species_name . }
OPTIONAL { ?library libns:name ?name . }
}"""
- bindings = {'library', 'library_id', 'name', 'species', 'species_name'}
+ bindings = set(['library', 'library_id', 'name', 'species', 'species_name'])
query = RDF.SPARQLQuery(body)
count = 0
for r in query.execute(model):
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix owl: <http://www.w3.org/2002/07/owl#>
+ prefix xhtmlv: <http://www.w3.org/1999/xhtml/vocab#>
select ?subject ?predicate ?object
where {
?subject ?predicate ?object
OPTIONAL { ?subject a ?class }
FILTER(!bound(?class))
+ FILTER(?predicate != xhtmlv:stylesheet)
}
"""
query = RDF.SPARQLQuery(body)