Skip to content

Commit

Permalink
Added tests to check for miss use of https://schema.org in definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Dataliberate committed Aug 2, 2019
1 parent b9c45ee commit 319c80f
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/test_graphs.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,42 @@ def test_termIn2PlusExtensions(self):
log.info("Term '%s' isPartOf %s extensions" % (row["term"],row["count"]))
self.assertEqual(len(nri1_results), 0, "Term in +1 extensions Found: %s" % len(nri1_results))

def test_termNothttps(self):
nri1= ('''select distinct ?term where {
?term ?p ?o.
FILTER strstarts(str(?term),"https://schema.org")
}
ORDER BY ?term
''')
nri1_results = self.rdflib_data.query(nri1)
if len(nri1_results):
log.info("Term defined as https errors!!!\n")
for row in nri1_results:
log.info("Term '%s' is defined as https " % (row["term"]))
self.assertEqual(len(nri1_results), 0, "Term defined as https Found: %s" % len(nri1_results))

def test_targetNothttps(self):
nri1= ('''prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix schema: <http://schema.org/>
select ?term ?target where {
?term schema:domainIncludes |
schema:rangeIncludes |
rdfs:subClassOf |
rdfs:subPropertyOf |
schema:supercededBy |
schema:inverseOf ?target.
filter strstarts(str(?target),"https://schema.org")
}
ORDER BY ?term
''')
nri1_results = self.rdflib_data.query(nri1)
if len(nri1_results):
log.info("Target defined as https errors!!!\n")
for row in nri1_results:
log.info("Term '%s' references term %s as https " % (row["term"],row["target"]))
self.assertEqual(len(nri1_results), 0, "Term defined as https Found: %s" % len(nri1_results))

@unittest.expectedFailure
def test_EnumerationWithoutEnums(self):
nri1= ('''select ?term where {
Expand Down

0 comments on commit 319c80f

Please sign in to comment.