New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

This comment has been minimized.

Show comment
Hide comment
@danbri

danbri Apr 28, 2016

Contributor

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

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

This comment has been minimized.

Show comment
Hide comment
@danbri

danbri Apr 28, 2016

Contributor
#!/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 ...?

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

This comment has been minimized.

Show comment
Hide comment
@danbri

danbri May 20, 2016

Contributor

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

Contributor

danbri commented May 20, 2016

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

danbri added a commit that referenced this issue May 20, 2016

@RichardWallis

This comment has been minimized.

Show comment
Hide comment
@RichardWallis

RichardWallis Jun 15, 2016

Contributor

Fixed in #1168

Contributor

RichardWallis commented Jun 15, 2016

Fixed in #1168

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