Skip to content
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
Closed

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

danbri opened this issue Apr 28, 2016 · 4 comments
Assignees

Comments

@danbri
Copy link
Contributor

@danbri 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
Copy link
Contributor Author

@danbri 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
Copy link
Contributor Author

@danbri 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
Copy link
Contributor Author

@danbri 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
Copy link
Contributor

@RichardWallis 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.