-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Mindey edited this page Nov 9, 2019
·
9 revisions
This wiki serves as a main repository of specific schemas to be used by our group to work with data sources.
If you have a data source, where you scraped an object, then extract its template using metaform.template( MYDATA )
, and then specify the field definitions using our vocabulary.
Let's say you've got some data:
data = [
{'a': 1, 'b': 'snack'},
{'a': 2, 'b': 'cake'}
]
Just use metaform.template(data)
, to get:
[{'a': {'*': ''}, 'b': {'*': ''}, '*': ''}]
Then, specify what each field means, by providing its term from any vocabulary, via metawiki shortcuts, which includes all LOV too:
schema = {'a': {'*': 'GH:wefindx/terms/Price#exchange-eur-real1dpoint'},
'b': {'*': 'GH:wefindx/terms/Meal#food-types-UnorderedSet'},
'*': 'GH:wefindx/terms/Purchase'}
import metaform
metaform.load(data).format(schema)
Let Everything Exist *
More info: metaformat.