We should have a unit test that makes sure term labels are alphanumeric #1136

Closed
danbri opened this Issue Apr 28, 2016 · 4 comments

Projects

None yet

2 participants

@danbri
Contributor
danbri commented Apr 28, 2016

i.e. complains if rdfs:label has chars that aren't in [^a-zA-Z0-9_ ].

  • Probably we really want to say [a-zA-Z]?[a-zA-Z0-9_]*
  • Tolerate whitespace at ends? in middle? for now. Do we want the ID in string form not a humanized version?
  • Make sure we run this against the data/ext/* extension definitions too.
@danbri danbri pushed a commit that referenced this issue Apr 28, 2016
Dan Brickley Added a test for rdfs:label being simple chars.
For #1136
34a552a
@danbri
Contributor
danbri commented Apr 28, 2016

@RichardWallis - I don't think this is running against the data/ext/health-lifesci/*rdfa data - can we do that easily?

@danbri
Contributor
danbri commented Apr 28, 2016
#!/usr/bin/env python

import os
import fnmatch

path = 'data/ext/'

files = [os.path.join(dirpath, f)
    for dirpath, dirnames, files in os.walk(path)
    for f in fnmatch.filter(files, '*.rdfa')]

for f in files:
   print f

Gives

data/ext/auto/auto.rdfa
data/ext/bib/bsdo-1.0.rdfa
data/ext/bib/comics.rdfa
data/ext/health-lifesci/med-health-core.rdfa
data/ext/health-lifesci/physical-activity-and-exercise.rdfa
data/ext/pending/issue-1004.rdfa
data/ext/pending/issue-1045.rdfa
data/ext/pending/issue-1050.rdfa
data/ext/pending/issue-1061.rdfa
data/ext/pending/issue-1062.rdfa
data/ext/pending/issue-1100.rdfa
data/ext/pending/issue-1125.rdfa
data/ext/pending/issue-243.rdfa
data/ext/pending/issue-271.rdfa
data/ext/pending/issue-447.rdfa
data/ext/pending/issue-743.rdfa
data/ext/pending/issue-template.rdfa
data/ext/test001/test001demo.rdfa

This could plug in around https://github.com/schemaorg/schemaorg/blob/sdo-deimos/tests/test_graphs.py#L51 ...?

@danbri danbri assigned danbri and RichardWallis and unassigned danbri Apr 28, 2016
@danbri
Contributor
danbri commented May 20, 2016

This now runs across extension data too thanks to @RichardWallis 's #1168

@danbri danbri pushed a commit that referenced this issue May 20, 2016
Dan Brickley Removed bib: and schema: prefixed labels.
See #1136
6515872
@RichardWallis
Contributor

Fixed in #1168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment