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
Assignees
Labels
site tools + python code Infrastructural issues around schema.org site. Most can ignore this!

Comments

@danbri
Copy link
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 added the site tools + python code Infrastructural issues around schema.org site. Most can ignore this! label Apr 28, 2016
@danbri
Copy link
Contributor Author

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 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 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

Fixed in #1168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site tools + python code Infrastructural issues around schema.org site. Most can ignore this!
Projects
None yet
Development

No branches or pull requests

2 participants