code
stringlengths 114
1.05M
| path
stringlengths 3
312
| quality_prob
float64 0.5
0.99
| learning_prob
float64 0.2
1
| filename
stringlengths 3
168
| kind
stringclasses 1
value |
---|---|---|---|---|---|
from typing import List
from typing import Dict
from pprint import pformat
from baseblock import Stopwatch
from baseblock import BaseObject
from schema_classification.dto import NormalizedSchema
class FilterExcludeOneOf(BaseObject):
""" Filter Classifications using EXCLUDE_ONE_OF Rulesets
Remove invalid classifications using the 'exclude-one-of' criteria.
This component returns valid candidates only.
"""
def __init__(self,
d_index: NormalizedSchema):
""" Change Log
Created:
7-Feb-2022
[email protected]
* https://github.com/grafflr/graffl-core/issues/169
Updated:
8-Jun-2022
[email protected]
* read schema in-memory
https://github.com/grafflr/deepnlu/issues/45
Updated:
30-Nov-2022
[email protected]
* renamed from 'computer-exclude-one-of' and basically rewrite from scratch
https://github.com/craigtrim/schema-classification/issues/4
Args:
d_index (dict): the in-memory schema
"""
BaseObject.__init__(self, __name__)
self._mapping = d_index['mapping']
self._d_exclude_oneof = d_index['exclude_one_of']
def process(self,
input_tokens: List[str]) -> Dict:
sw = Stopwatch()
invalid_names = []
s_input_tokens = set(input_tokens)
for classification in self._mapping:
for ruleset in self._mapping[classification]:
if 'exclude_one_of' not in ruleset:
continue
exclude_one_of = set(ruleset['exclude_one_of'])
if not len(exclude_one_of):
continue
common = exclude_one_of.intersection(s_input_tokens)
# at least one exclusion token must be found
if not len(common):
continue
invalid_names.append(classification)
if self.isEnabledForDebug:
self.logger.debug('\n'.join([
'Invalid Classification Found',
f'\tName: {classification}',
f'\tRule Tokens: {exclude_one_of}',
f'\tMatched Rule Tokens: {common}',
f'\tInput Tokens: {input_tokens}']))
if self.isEnabledForInfo:
self.logger.info('\n'.join([
'Filtering Complete',
f'\tRemoved Classifications: {len(invalid_names)}',
f'\tTotal Time: {str(sw)}']))
return invalid_names
|
/schema_classification-0.1.8-py3-none-any.whl/schema_classification/dmo/filter_exclude_oneof.py
| 0.876066 | 0.315565 |
filter_exclude_oneof.py
|
pypi
|
import pprint
from typing import Dict
from baseblock import BaseObject
from schema_classification.dto import Markers
from schema_classification.dto import ExplainResult
from schema_classification.dto import MappingResult
class ConfidenceIncludeAllOf(BaseObject):
""" Determine Confidence Level for Selected Mapping """
def __init__(self,
mapping: Dict,
markers: Markers):
"""
Created:
7-Feb-2022
[email protected]
* https://github.com/grafflr/graffl-core/issues/169
:param d_include_oneof:
relevant section of mapping ruleset
"""
BaseObject.__init__(self, __name__)
self._mapping = mapping
self._markers = markers
@staticmethod
def _max_confidence(d: Dict) -> Dict:
"""
Sample Input
{ 23.0: { 'classification': 'GICS_CODE_50102010_2',
'confidence': 23.0,
'explain': <ExplainResult.INCLUDE_NEAR_MATCH_1: 30>},
35.0: { 'classification': 'GICS_CODE_25302020_2',
'confidence': 35.0,
'explain': <ExplainResult.INCLUDE_NEAR_MATCH_1: 30>},
85.0: { 'classification': 'GICS_CODE_50101020_3',
'confidence': 85.0,
'explain': <ExplainResult.INCLUDE_NEAR_MATCH_1: 30>}}
Sample Output:
{ 'classification': 'GICS_CODE_50101020_3',
'confidence': 85.0,
'explain': <ExplainResult.INCLUDE_NEAR_MATCH_1: 30>}
"""
return d[max(d)]
def process(self) -> MappingResult or None:
confidence = 100.0
d = {}
for k in self._mapping:
for mapping in self._mapping[k]:
if 'include_all_of' in mapping:
# mapping-supplied
map_tags = set(mapping['include_all_of'])
usr_tags = set(self._markers.keys()) # user supplied
matches = map_tags.intersection(usr_tags)
total_matches = len(matches)
if total_matches == 0:
continue
total_map_tags = len(map_tags)
total_usr_tags = len(usr_tags)
def compute() -> float:
base = 5.00
boost = ((base - total_map_tags) * base) / 100
confidence = (total_matches / total_map_tags) - boost
confidence = round(confidence * 100, 0)
if confidence > 100:
return 99
if confidence < 1:
return 0
return confidence
confidence = compute()
self.logger.debug('\n'.join([
'Include All Confidence Computation',
f'\tClassification: {k}',
f'\tUser Tags ({total_usr_tags}): {usr_tags}',
f'\tMapping Tags ({total_map_tags}): {map_tags}',
f'\tMatches ({total_matches}): {matches}',
f'\tConfidence: {confidence}']))
if confidence == 0:
continue
d[confidence] = MappingResult(confidence=confidence,
classification=k,
explain=ExplainResult.INCLUDE_NEAR_MATCH_1)
if not len(d):
return None
return self._max_confidence(d)
|
/schema_classification-0.1.8-py3-none-any.whl/schema_classification/dmo/confidence_include_allof.py
| 0.745676 | 0.252833 |
confidence_include_allof.py
|
pypi
|
from typing import Any
from typing import Dict
from typing import List
from typing import DefaultDict
from collections import defaultdict
from baseblock import Stopwatch
from baseblock import BaseObject
class IndexIncludeAllOf(BaseObject):
""" Generate an Index of 'include-all-of' Mappings"""
def __init__(self,
mapping: Dict):
""" Change Log
Created:
7-Feb-2022
[email protected]
* https://github.com/grafflr/graffl-core/issues/169
Updated:
8-Jun-2022
[email protected]
* https://github.com/grafflr/deepnlu/issues/45
:param mapping
"""
BaseObject.__init__(self, __name__)
self._mapping = mapping
def process(self) -> Dict:
sw = Stopwatch()
d = defaultdict(list)
for k in self._mapping:
for mapping in self._mapping[k]:
if 'include_all_of' not in mapping:
continue
if not len(mapping['include_all_of']):
continue
cluster = sorted(set(mapping['include_all_of']))
first_term = cluster[0]
terms_n = sorted(set(cluster[1:]))
if first_term not in d:
d[first_term] = []
update_existing_flag = False # NLP-889-12303; an example of this structure
for existing in d[first_term]:
if terms_n == existing['terms']:
existing['mappings'].append(k)
update_existing_flag = True
if not update_existing_flag:
d[cluster[0]].append({ # NLP-889-12304; an example of this structure
'mappings': [k],
'terms': terms_n})
if self.isEnabledForDebug:
self.logger.debug('\n'.join([
'Generated Index: Include All Of',
f'\tTotal Rows: {len(d)}',
f'\tTotal Time: {str(sw)}']))
return dict(d)
|
/schema_classification-0.1.8-py3-none-any.whl/schema_classification/dmo/index_include_allof.py
| 0.767341 | 0.178418 |
index_include_allof.py
|
pypi
|
from typing import Dict
from typing import List
from baseblock import Stopwatch
from baseblock import BaseObject
from schema_classification.dto import NormalizedSchema
class FilterIncludeOneOf(BaseObject):
""" Compute INCLUDE_ONE_OF Rulesets """
def __init__(self,
d_index: NormalizedSchema):
""" Change Log
Created:
7-Feb-2022
[email protected]
* https://github.com/grafflr/graffl-core/issues/169
Updated:
8-Jun-2022
[email protected]
* read schema in-memory
https://github.com/grafflr/deepnlu/issues/45
Updated:
30-Nov-2022
[email protected]
* renamed from 'computer-include-one-of' and basically rewrite from scratch
https://github.com/craigtrim/schema-classification/issues/4
Args:
d_index (dict): the in-memory schema
"""
BaseObject.__init__(self, __name__)
self._mapping = d_index['mapping']
self._d_include_oneof = d_index['include_one_of']
def process(self,
input_tokens: List[str]) -> Dict:
sw = Stopwatch()
invalid_names = []
s_input_tokens = set(input_tokens)
for classification in self._mapping:
for ruleset in self._mapping[classification]:
if 'include_one_of' not in ruleset:
continue
include_one_of = set(ruleset['include_one_of'])
if not len(include_one_of):
continue
common = include_one_of.intersection(s_input_tokens)
# this classification is invalid when no common tokens are found
if len(common):
continue
invalid_names.append(classification)
if self.isEnabledForDebug:
self.logger.debug('\n'.join([
'Invalid Classification Found',
f'\tName: {classification}',
f'\tRule Tokens: {include_one_of}',
f'\tMatched Rule Tokens: {common}',
f'\tInput Tokens: {input_tokens}']))
if self.isEnabledForInfo:
self.logger.info('\n'.join([
'Filtering Complete',
f'\tRemoved Classifications: {len(invalid_names)}',
f'\tTotal Time: {str(sw)}']))
return invalid_names
|
/schema_classification-0.1.8-py3-none-any.whl/schema_classification/dmo/filter_include_oneof.py
| 0.83193 | 0.24951 |
filter_include_oneof.py
|
pypi
|
from enum import Enum
from psycopg2 import sql
class DataTypes(Enum):
BOOL = "bool"
TEXT = "text"
CHAR = "char"
VARCHAR = "varchar"
DOUBLE = "float8"
INTEGER = "int"
DECIMAL = "decimal"
DATE = "date"
@staticmethod
def limited():
return [DataTypes.CHAR, DataTypes.VARCHAR]
@staticmethod
def convert(string=None):
if string is None:
return None, None
limit = None
if any(datatype.value in string for datatype in DataTypes.limited()) \
and '(' in string:
split = string.replace(')', '').split('(')
string, limit = split[0], int(split[-1])
for member in DataTypes.__members__.values():
if member.value == string:
return member, limit
return None, None
@staticmethod
def belongs_to_types(string, *enums):
types = [member.value for member in DataTypes.__members__.values()
if member in enums]
for data_type in types:
if string == data_type:
return True
return False
class Column:
RENAME = "RENAME COLUMN {old_name} TO {new_name}"
ADD_CONST = "ADD CONSTRAINT {constraint_name} FOREIGN KEY {fk_name} REFERENCES {primary_table} ({fk_name})"
@staticmethod
def define(**col_def):
"""Create a column definition clause in **PostgreSQL**. Column names will be parameterized to prevent injection, i.e. the `name` passed into this method is not the name of the column, but the name of the column parameter in the clause that is passed into the query cursor.
:param kwargs: Keyword arguments. The input format should make the `schema.json` input format.
:return: Column definition clause for `CREATE TABLE` **PostgreSQL** statement.
:rtype: str
"""
if col_def.get('primary_key', None) is not None:
return "{%s} SERIAL PRIMARY KEY" % (col_def['name'])
if col_def.get('foreign_key_references', None) is not None:
return "{%s} integer REFERENCES {fkr}" % (col_def['name'])
# data type is not parameterized in string, so it is converted into an enum before formatting
# so user input can never directly touched the query string
enumerated_type, limit = DataTypes.convert(col_def['type'])
if enumerated_type is None:
raise ValueError(
"No data type specified for column %s" % (col_def['name']))
definition = "{%s} %s" % (col_def['name'], enumerated_type.value)
if limit is not None:
definition += "(%s)" % (limit)
if col_def.get('not_null', None) is not None:
definition += " NOT NULL"
return definition
@staticmethod
def add(**col_def):
"""`ADD COLUMN` subclause in **PostgreSQL**, for use in `ALTER TABLE` clauses. Column names will be parameterized to prevent injection, i.e. the `name` passed into this method is not the name of the column, but the name of the column parameter in the clause that is passed into the query cursor.
:param kwargs: Keyword arguments. The input format should make the `schema.json` input format.
:return: Column definition clause for `ADD COLUMN` **PostgreSQL** statement.
:rtype: str
"""
# data type is not parameterized in string, so it is converted into an enum before formatting
# so user input can never directly touched the query string
enumerated_type, limit = DataTypes.convert(col_def['type'])
if enumerated_type is None:
raise ValueError(
"No data type specified for column %s" % (col_def['name']))
add_column = "ADD COLUMN {%s} %s" % (
col_def['name'], enumerated_type.value)
if limit is not None:
definition += "(%s)" % (limit)
if col_def.get('not_null', None):
add_column += " NOT NULL"
if col_def.get('foreign_key_references', None) is not None:
add_column += "CONSTRAINT fk REFERENCES {fkr}"
return add_column
@staticmethod
def add_constraint(**col_def):
pass
@staticmethod
def drop_constraint(**col_def):
pass
@staticmethod
def drop(**col_def):
return "DROP COLUMN {%s}" % col_def['name']
class Table:
@staticmethod
def create(table_name, *col_defs):
"""Generate a `CREATE TABLE` PostgreSQL statement. Table and column names will be parameterized in query to prevent injection, i.e. `table_name` and `col_def[]['name']` are not the names of the table and columns, but the names of the column and column parameters in the statement.
:param table_name: name of table
:type table_name: string
:param `*args`: column objects from `schema.tables[]` structure, with `name` replaced by a parameterized key.
:return: `CREATE TABLE` statement, parameter names, parameter values
:rtype: tuple
"""
create_table = "CREATE TABLE {table_name} ("
parameters = [table_name]
parameter_names = ['table_name']
for i, col_def in enumerate(col_defs):
# parameterize column_name
param_name = 'col_' + str(i)
parameters.append(col_def['name'])
parameter_names.append(param_name)
col_def['name'] = param_name
col_statement = Column.define(**col_def)
create_table += col_statement
if col_defs.index(col_def) != len(col_defs) - 1:
create_table += ", "
create_table += ");"
return create_table, parameter_names, parameters
@staticmethod
def alter(table_name, **col_formulae):
statement = ""
parameters = [table_name]
parameter_names = ['table_name']
accumulated = 0
for verb, cols in col_formulae.items():
alter_table = None
for i, formula in enumerate(cols):
param_name = 'col_' + str(i + accumulated)
parameters.append(formula['name'])
parameter_names.append(param_name)
formula['name'] = param_name
if verb == 'ALTERED':
pass
elif verb == 'ADDED':
if alter_table is None:
alter_table = "ALTER TABLE {table_name} "
else:
alter_table += ", "
alter_table += Column.add(**formula)
elif verb == 'REMOVED':
if alter_table is None:
alter_table = "ALTER TABLE {table_name} "
alter_table += Column.drop(**formula)
if len(cols) > 0:
accumulated = len(cols)
if alter_table is not None:
statement += alter_table + "; "
return statement, parameter_names, parameters
|
/schema_cntl-1.0.1-py3-none-any.whl/schema_cntl/dialects/postgres.py
| 0.689933 | 0.272709 |
postgres.py
|
pypi
|
from ansible.inventory.manager import InventoryManager # pylint: disable=import-error
from ansible.parsing.dataloader import DataLoader # pylint: disable=import-error
from ansible.vars.manager import VariableManager # pylint: disable=import-error
from ansible.template import Templar # pylint: disable=import-error
# Referenced https://github.com/fgiorgetti/qpid-dispatch-tests/ for the below class
class AnsibleInventory:
"""AnsibleInventory."""
def __init__(self, inventory=None, extra_vars=None):
"""Imitates Ansible Inventory Loader.
Args:
inventory (str): Path to Ansible Inventory files.
extra_vars (dict): Extra Vars passed at run time.
"""
self.inventory = inventory
self.loader = DataLoader()
self.inv_mgr = InventoryManager(loader=self.loader, sources=self.inventory)
self.var_mgr = VariableManager(loader=self.loader, inventory=self.inv_mgr)
# TODO As of Ansible==2.8.0 the extra_vars property cannot be set to VariableManager
# This needs to be investigated and fixed properly
self.extra_vars = extra_vars or {}
def get_hosts_containing(self, var=None):
"""Gets hosts that have a value for ``var``.
If ``var`` is None, then all hosts in the inventory will be returned.
Args:
var (str): The variable to use to restrict hosts.
Returns:
list: All ansible.inventory.host.Host objects that define ``var``.
"""
all_hosts = self.inv_mgr.get_hosts()
if var is None:
return all_hosts
# Only add hosts that define the variable.
hosts_with_var = [host for host in all_hosts if var in self.var_mgr.get_vars(host=host)]
return hosts_with_var
def get_host_vars(self, host):
"""Retrieves Jinja2 rendered variables for ``host``.
Args:
host (ansible.inventory.host.Host): The host to retrieve variable data from.
Returns:
dict: The variables defined by the ``host`` in Ansible Inventory.
"""
data = self.var_mgr.get_vars(host=host)
templar = Templar(variables=data, loader=self.loader)
return templar.template(data, fail_on_undefined=False)
def get_clean_host_vars(self, host):
"""Return clean hostvars for a given host, cleaned up of all keys inserted by Templar.
Args:
host (ansible.inventory.host.Host): The host to retrieve variable data from.
Raises:
TypeError: When "magic_vars_to_evaluate" is declared in an Ansible inventory file and is not of type list,
a type error is raised
Returns:
dict: clean hostvars
"""
keys_cleanup = [
"inventory_file",
"inventory_dir",
"inventory_hostname",
"inventory_hostname_short",
"group_names",
"ansible_facts",
"playbook_dir",
"ansible_playbook_python",
"groups",
"omit",
"ansible_version",
"ansible_config_file",
"schema_enforcer_schema_ids",
"schema_enforcer_strict",
"schema_enforcer_automap_default",
"magic_vars_to_evaluate",
]
hostvars = self.get_host_vars(host)
# Extract magic vars which should be evaluated
magic_vars_to_evaluate = hostvars.get("magic_vars_to_evaluate", [])
if not isinstance(magic_vars_to_evaluate, list):
raise TypeError(f"magic_vars_to_evaluate variable configured for host {host.name} must be of type list")
keys_cleanup = list(set(keys_cleanup) - set(magic_vars_to_evaluate))
for key in keys_cleanup:
if key in hostvars:
del hostvars[key]
return hostvars
@staticmethod
def get_applicable_schemas(hostvars, smgr, declared_schema_ids, automap):
"""Get applicable schemas.
Search an explicit mapping to determine the schemas which should be used to validate hostvars
for a given host.
If an explicit mapping is not defined, correlate top level keys in the structured data with top
level properties in the schema to acquire applicable schemas.
Args:
hostvars (dict): dictionary of cleaned host vars which will be evaluated against schema
smgr (schema_enforcer.schemas.manager.SchemaManager): SchemaManager object
declared_schema_ids (list): A list of declared schema IDs inferred from schema_enforcer_schemas variable
automap (bool): Whether or not to use the `automap` feature to automatically map top level hostvar keys
to top level schema definition properties if no schema ids are declared (list of schema ids is empty)
Returns:
applicable_schemas (dict): dictionary mapping schema_id to schema obj for all applicable schemas
"""
applicable_schemas = {}
for key in hostvars.keys():
# extract applicable schema ID to JsonSchema objects if schema_ids are declared
if declared_schema_ids:
for schema_id in declared_schema_ids:
applicable_schemas[schema_id] = smgr.schemas[schema_id]
# extract applicable schema ID to JsonSchema objects based on host var to top level property mapping.
elif automap:
for schema in smgr.schemas.values():
if key in schema.top_level_properties:
applicable_schemas[schema.id] = schema
continue
return applicable_schemas
def get_schema_validation_settings(self, host):
"""Parse Ansible Schema Validation Settings from a host object.
Validate settings or ensure an error is raised in the event an invalid parameter is
configured in the host file.
Args:
host (AnsibleInventory.host): Ansible Inventory Host Object
Raises:
TypeError: Raised when one of the schema configuration parameters is of the wrong type
ValueError: Raised when one of the schema configuration parameters is incorrectly configured
Returns:
(dict): Dict of validation settings with keys "declared_schema_ids", "strict", and "automap"
"""
# Generate host_var and automatically remove all keys inserted by ansible
hostvars = self.get_host_vars(host)
# Extract declared_schema_ids from hostvar setting
declared_schema_ids = []
if "schema_enforcer_schema_ids" in hostvars:
if not isinstance(hostvars["schema_enforcer_schema_ids"], list):
raise TypeError(f"'schema_enforcer_schema_ids' attribute defined for {host.name} must be of type list")
declared_schema_ids = hostvars["schema_enforcer_schema_ids"]
# Extract whether to use a strict validator or a loose validator from hostvar setting
strict = False
if "schema_enforcer_strict" in hostvars:
if not isinstance(hostvars["schema_enforcer_strict"], bool):
raise TypeError(f"'schema_enforcer_strict' attribute defined for {host.name} must be of type bool")
strict = hostvars["schema_enforcer_strict"]
automap = True
if "schema_enforcer_automap_default" in hostvars:
if not isinstance(hostvars["schema_enforcer_automap_default"], bool):
raise TypeError(
f"'schema_enforcer_automap_default' attribute defined for {host.name} must be of type bool"
)
automap = hostvars["schema_enforcer_automap_default"]
# Raise error if settings are set incorrectly
if strict and not declared_schema_ids:
msg = (
f"The 'schema_enforcer_strict' parameter is set for {host.name} but the 'schema_enforcer_schema_ids' parameter does not declare a schema id. "
"The 'schema_enforcer_schema_ids' parameter MUST be defined as a list declaring only one schema ID if 'schema_enforcer_strict' is set."
)
raise ValueError(msg)
if strict and declared_schema_ids and len(declared_schema_ids) > 1:
msg = (
f"The 'schema_enforcer_strict' parameter is set for {host.name} but the 'schema_enforcer_schema_ids' parameter declares more than one schema id. "
"The 'schema_enforcer_schema_ids' parameter MUST be defined as a list declaring only one schema ID if 'schema_enforcer_strict' is set."
)
raise ValueError(msg)
return {
"declared_schema_ids": declared_schema_ids,
"strict": strict,
"automap": automap,
}
def print_schema_mapping(self, hosts, limit, smgr):
"""Print host to schema IDs mapping.
Args:
hosts (list): A list of ansible.inventory.host.Host objects for which the mapping should be printed
limit (str): The host to which to limit the search
smgr (schema_enforcer.schemas.manager.SchemaManager): Schema manager which handles schema objects
"""
print_dict = {}
for host in hosts:
if limit and host.name != limit:
continue
# Get hostvars
hostvars = self.get_clean_host_vars(host)
# Acquire validation settings for the given host
schema_validation_settings = self.get_schema_validation_settings(host)
declared_schema_ids = schema_validation_settings["declared_schema_ids"]
automap = schema_validation_settings["automap"]
# Validate declared schemas exist
smgr.validate_schemas_exist(declared_schema_ids)
# Acquire schemas applicable to the given host
applicable_schemas = self.get_applicable_schemas(hostvars, smgr, declared_schema_ids, automap)
# Add an element to the print dict for this host
print_dict[host.name] = list(applicable_schemas.keys())
if print_dict:
print("{:25} Schema ID".format("Ansible Host")) # pylint: disable=consider-using-f-string
print("-" * 80)
print_strings = []
for hostname, schema_ids in print_dict.items():
print_strings.append(f"{hostname:25} {schema_ids}")
print("\n".join(sorted(print_strings)))
|
/schema_enforcer-1.2.2.tar.gz/schema_enforcer-1.2.2/schema_enforcer/ansible_inventory.py
| 0.777849 | 0.193795 |
ansible_inventory.py
|
pypi
|
import os
import os.path
import sys
from pathlib import Path
from typing import Dict, List, Optional
import toml
from pydantic import BaseSettings, ValidationError
SETTINGS = None
class Settings(BaseSettings): # pylint: disable=too-few-public-methods
"""Main Settings Class for the project.
The type of each setting is defined using Python annotations
and is validated when a config file is loaded with Pydantic.
Most input files specific to this project are expected to be located in the same directory. e.g.
schema/
- definitions
- schemas
"""
# Main directory names
main_directory: str = "schema"
definition_directory: str = "definitions"
schema_directory: str = "schemas"
validator_directory: str = "validators"
test_directory: str = "tests"
# Settings specific to the schema files
schema_file_extensions: List[str] = [".json", ".yaml", ".yml"] # Do we still need that ?
schema_file_exclude_filenames: List[str] = []
# settings specific to search and identify all instance file to validate
data_file_search_directories: List[str] = ["./"]
data_file_extensions: List[str] = [".json", ".yaml", ".yml"]
data_file_exclude_filenames: List[str] = [".yamllint.yml", ".travis.yml"]
data_file_automap: bool = True
ansible_inventory: Optional[str]
schema_mapping: Dict = {}
class Config: # pylint: disable=too-few-public-methods
"""Additional parameters to automatically map environment variable to some settings."""
fields = {
"main_directory": {"env": "jsonschema_directory"},
"definition_directory": {"env": "jsonschema_definition_directory"},
}
def load(config_file_name="pyproject.toml", config_data=None):
"""Load configuration.
Configuration is loaded from a file in pyproject.toml format that contains the settings,
or from a dictionary of those settings passed in as "config_data"
The settings for this app are expected to be in [tool.json_schema_testing] in TOML
if nothing is found in the config file or if the config file do not exist, the default values will be used.
config_data can be passed in to override the config_file_name. If this is done, a combination of the data
specified and the defaults for parameters not specified will be used, and settings in the config file will
be ignored.
Args:
config_file_name (str, optional): Name of the configuration file to load. Defaults to "pyproject.toml".
config_data (dict, optional): dict to load as the config file instead of reading the file. Defaults to None.
"""
global SETTINGS # pylint: disable=global-statement
if config_data:
SETTINGS = Settings(**config_data)
return
if os.path.exists(config_file_name):
config_string = Path(config_file_name).read_text(encoding="utf-8")
config_tmp = toml.loads(config_string)
if "tool" in config_tmp and "schema_enforcer" in config_tmp.get("tool", {}):
SETTINGS = Settings(**config_tmp["tool"]["schema_enforcer"])
return
SETTINGS = Settings()
def load_and_exit(config_file_name="pyproject.toml", config_data=None):
"""Calls load, but wraps it in a try except block.
This is done to handle a ValidationErorr which is raised when settings are specified but invalid.
In such cases, a message is printed to the screen indicating the settings which don't pass validation.
Args:
config_file_name (str, optional): [description]. Defaults to "pyproject.toml".
config_data (dict, optional): [description]. Defaults to None.
"""
try:
load(config_file_name=config_file_name, config_data=config_data)
except ValidationError as err:
print(f"Configuration not valid, found {len(err.errors())} error(s)")
for error in err.errors():
print(f" {'/'.join(error['loc'])} | {error['msg']} ({error['type']})")
sys.exit(1)
|
/schema_enforcer-1.2.2.tar.gz/schema_enforcer-1.2.2/schema_enforcer/config.py
| 0.712432 | 0.334168 |
config.py
|
pypi
|
import sys
import click
from termcolor import colored
from schema_enforcer.utils import MutuallyExclusiveOption
from schema_enforcer import config
from schema_enforcer.schemas.manager import SchemaManager
from schema_enforcer.instances.file import InstanceFileManager
from schema_enforcer.utils import error
from schema_enforcer.exceptions import InvalidJSONSchema
@click.group()
def main():
"""SCHEMA ENFORCER.
This tool is used to ensure data adheres to a schema definition. The data can come
from YAML files, JSON files, or an Ansible inventory. The schema to which the data
should adhere can currently be defined using the JSONSchema language in YAML or JSON
format.
"""
@click.option("--show-pass", default=False, help="Shows validation checks that passed", is_flag=True, show_default=True)
@click.option(
"--strict",
default=False,
help="Forces a stricter schema check that warns about unexpected additional properties",
is_flag=True,
show_default=True,
)
@click.option(
"--show-checks",
default=False,
help="Shows the schemas to be checked for each structured data file",
is_flag=True,
show_default=True,
)
@main.command()
def validate(show_pass, show_checks, strict): # noqa D205
"""Validates instance files against defined schema.
\f
Args:
show_pass (bool): show successful schema validations
show_checks (bool): show schemas which will be validated against each instance file
strict (bool): Forces a stricter schema check that warns about unexpected additional properties
"""
config.load()
# ---------------------------------------------------------------------
# Load Schema(s) from disk
# ---------------------------------------------------------------------
try:
smgr = SchemaManager(config=config.SETTINGS)
except InvalidJSONSchema as exc:
error(str(exc))
sys.exit(1)
if not smgr.schemas:
error("No schemas were loaded")
sys.exit(1)
# ---------------------------------------------------------------------
# Load Instances
# ---------------------------------------------------------------------
ifm = InstanceFileManager(config=config.SETTINGS)
if not ifm.instances:
error("No instance files were found to validate")
sys.exit(1)
if config.SETTINGS.data_file_automap:
ifm.add_matches_by_property_automap(smgr)
if show_checks:
ifm.print_schema_mapping()
sys.exit(0)
error_exists = False
for instance in ifm.instances:
for result in instance.validate(smgr, strict):
result.instance_type = "FILE"
result.instance_name = instance.filename
result.instance_location = instance.path
if not result.passed():
error_exists = True
result.print()
elif result.passed() and show_pass:
result.print()
if not error_exists:
print(colored("ALL SCHEMA VALIDATION CHECKS PASSED", "green"))
else:
sys.exit(1)
@click.option(
"--list",
"list_schemas",
default=False,
cls=MutuallyExclusiveOption,
mutually_exclusive=["generate_invalid", "check", "schema-id", "dump"],
help="List all available schemas",
is_flag=True,
)
@click.option(
"--dump",
"dump_schemas",
default=False,
cls=MutuallyExclusiveOption,
mutually_exclusive=["generate_invalid", "check", "list"],
help="Dump full schema for all schemas or schema-id",
is_flag=True,
)
@click.option(
"--check",
default=False,
cls=MutuallyExclusiveOption,
mutually_exclusive=["generate_invalid", "list", "dump"],
help="Validates that all schemas are valid (spec and unit tests)",
is_flag=True,
)
@click.option(
"--generate-invalid",
default=False,
cls=MutuallyExclusiveOption,
mutually_exclusive=["check", "list", "dump"],
help="Generates expected invalid result from a given schema [--schema-id] and data defined in a data file",
is_flag=True,
)
@click.option(
"--schema-id", default=None, cls=MutuallyExclusiveOption, mutually_exclusive=["list"], help="The name of a schema."
)
@main.command()
def schema(check, generate_invalid, list_schemas, schema_id, dump_schemas): # noqa: D417,D301,D205
"""Manage your schemas.
\f
Args:
check (bool): Validates that all schemas are valid (spec and unit tests)
generate_invalid (bool): Generates expected invalid data from a given schema
list_schemas (bool): List all available schemas
schema_id (str): Name of schema to evaluate
dump_schemas (bool): Dump all schema data or a single schema if schema_id is provided
"""
if not check and not generate_invalid and not list_schemas and not schema_id and not dump_schemas:
error(
"The 'schema' command requires one or more arguments. You can run the command 'schema-enforcer schema --help' to see the arguments available."
)
sys.exit(1)
config.load()
# ---------------------------------------------------------------------
# Load Schema(s) from disk
# ---------------------------------------------------------------------
try:
smgr = SchemaManager(config=config.SETTINGS)
except InvalidJSONSchema as exc:
error(str(exc))
sys.exit(1)
if not smgr.schemas:
error("No schemas were loaded")
sys.exit(1)
if list_schemas:
smgr.print_schemas_list()
sys.exit(0)
if dump_schemas:
smgr.dump_schema(schema_id)
sys.exit(0)
if generate_invalid:
if not schema_id:
sys.exit("Please indicate the schema you'd like to generate invalid data for using the --schema-id flag")
smgr.generate_invalid_tests_expected(schema_id=schema_id)
sys.exit(0)
if check:
smgr.test_schemas()
sys.exit(0)
@main.command()
@click.option("--inventory", "-i", help="Ansible inventory file.", required=False)
@click.option("--host", "-h", "limit", help="Limit the execution to a single host.", required=False)
@click.option("--show-pass", default=False, help="Shows validation checks that passed", is_flag=True, show_default=True)
@click.option(
"--show-checks",
default=False,
help="Shows the schemas to be checked for each ansible host",
is_flag=True,
show_default=True,
)
def ansible(
inventory, limit, show_pass, show_checks
): # pylint: disable=too-many-branches,too-many-locals,too-many-locals,too-many-statements # noqa: D417,D301
"""Validate the hostvars for all hosts within an Ansible inventory.
The hostvars are dynamically rendered based on groups to which each host belongs.
For each host, if a variable `schema_enforcer_schema_ids` is defined, it will be used
to determine which schemas should be use to validate each key. If this variable is
not defined, the hostvars top level keys will be automatically mapped to a schema
definition's top level properties to automatically infer which schema should be used
to validate which hostvar.
\f
Args:
inventory (string): The name of the file used to construct an ansible inventory.
limit (string, None): Name of a host to limit the execution to.
show_pass (bool): Shows validation checks that pass. Defaults to False.
show_checks (bool): Shows the schema ids each host will be evaluated against.
Example:
$ cd examples/ansible
$ ls -ls
total 8
drwxr-xr-x 5 damien staff 160B Jul 25 16:37 group_vars
drwxr-xr-x 4 damien staff 128B Jul 25 16:37 host_vars
-rw-r--r-- 1 damien staff 69B Jul 25 16:37 inventory.ini
drwxr-xr-x 4 damien staff 128B Jul 25 16:37 schema
$ schema-enforcer ansible -i inventory.ini
Found 4 hosts in the inventory
FAIL | [ERROR] False is not of type 'string' [HOST] spine1 [PROPERTY] dns_servers:0:address
FAIL | [ERROR] False is not of type 'string' [HOST] spine2 [PROPERTY] dns_servers:0:address
$ schema-enforcer ansible -i inventory.ini -h leaf1
Found 4 hosts in the inventory
ALL SCHEMA VALIDATION CHECKS PASSED
$ schema-enforcer ansible -i inventory.ini -h spine1 --show-pass
Found 4 hosts in the inventory
FAIL | [ERROR] False is not of type 'string' [HOST] spine1 [PROPERTY] dns_servers:0:address
PASS | [HOST] spine1 [SCHEMA ID] schemas/interfaces
"""
# Ansible is currently always installed by schema-enforcer. This was added in the interest of making ansible an
# optional dependency. We decided to make two separate packages installable via PyPi, one with ansible, one without.
# This has been left in the code until such a time as we implement the change to two packages so code will not need
# to be re-written/
try:
from schema_enforcer.ansible_inventory import AnsibleInventory # pylint: disable=import-outside-toplevel
except ModuleNotFoundError:
error(
"ansible package not found, you can run the command 'pip install schema-enforcer[ansible]' to install the latest schema-enforcer sanctioned version."
)
sys.exit(1)
if inventory:
config.load(config_data={"ansible_inventory": inventory})
else:
config.load()
# ---------------------------------------------------------------------
# Load Schema(s) from disk
# ---------------------------------------------------------------------
try:
smgr = SchemaManager(config=config.SETTINGS)
except InvalidJSONSchema as exc:
error(str(exc))
sys.exit(1)
if not smgr.schemas:
error("No schemas were loaded")
sys.exit(1)
# ---------------------------------------------------------------------
# Load Ansible Inventory file
# - generate hostvar for all devices in the inventory
# - Validate Each key in the hostvar individually against the schemas defined in the var jsonschema_mapping
# ---------------------------------------------------------------------
inv = AnsibleInventory(inventory=config.SETTINGS.ansible_inventory)
hosts = inv.get_hosts_containing()
print(f"Found {len(hosts)} hosts in the inventory")
if show_checks:
inv.print_schema_mapping(hosts, limit, smgr)
sys.exit(0)
error_exists = False
for host in hosts:
if limit and host.name != limit:
continue
# Acquire Host Variables
hostvars = inv.get_clean_host_vars(host)
# Acquire validation settings for the given host
schema_validation_settings = inv.get_schema_validation_settings(host)
declared_schema_ids = schema_validation_settings["declared_schema_ids"]
strict = schema_validation_settings["strict"]
automap = schema_validation_settings["automap"]
# Validate declared schemas exist
smgr.validate_schemas_exist(declared_schema_ids)
# Acquire schemas applicable to the given host
applicable_schemas = inv.get_applicable_schemas(hostvars, smgr, declared_schema_ids, automap)
for schema_obj in applicable_schemas.values():
# Combine host attributes into a single data structure matching to properties defined at the top level of the schema definition
if not strict:
data = {}
for var in schema_obj.top_level_properties:
data.update({var: hostvars.get(var)})
# If the schema_enforcer_strict bool is set, hostvars should match a single schema exactly.
# Thus, we want to pass the entirety of the cleaned host vars into the validate method rather
# than creating a data structure with only the top level vars defined by the schema.
else:
data = hostvars
# Validate host vars against schema
schema_obj.validate(data=data, strict=strict)
for result in schema_obj.get_results():
result.instance_type = "HOST"
result.instance_hostname = host.name
if not result.passed():
error_exists = True
result.print()
elif result.passed() and show_pass:
result.print()
schema_obj.clear_results()
if not error_exists:
print(colored("ALL SCHEMA VALIDATION CHECKS PASSED", "green"))
else:
sys.exit(1)
|
/schema_enforcer-1.2.2.tar.gz/schema_enforcer-1.2.2/schema_enforcer/cli.py
| 0.483892 | 0.30641 |
cli.py
|
pypi
|
import copy
import json
import os
from functools import cached_property
from jsonschema import Draft7Validator # pylint: disable=import-self
from schema_enforcer.schemas.validator import BaseValidation
from schema_enforcer.validation import ValidationResult, RESULT_FAIL, RESULT_PASS
class JsonSchema(BaseValidation): # pylint: disable=too-many-instance-attributes
"""class to manage jsonschema type schemas."""
schematype = "jsonchema"
def __init__(self, schema, filename, root):
"""Initilize a new JsonSchema object from a dict.
Args:
schema (dict): Data representing the schema. Must be jsonschema valid.
filename (string): Name of the schema file on the filesystem.
root (string): Absolute path to the directory where the schema file is located.
"""
super().__init__()
self.filename = filename
self.root = root
self.data = schema
self.id = self.data.get("$id") # pylint: disable=invalid-name
self.top_level_properties = set(self.data.get("properties"))
self.validator = None
self.strict_validator = None
self.format_checker = Draft7Validator.FORMAT_CHECKER
@cached_property
def v7_schema(self):
"""Draft7 Schema."""
local_dirname = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(local_dirname, "draft7_schema.json"), encoding="utf-8") as fhd:
v7_schema = json.loads(fhd.read())
return v7_schema
def get_id(self):
"""Return the unique ID of the schema."""
return self.id
def validate(self, data, strict=False):
"""Validate a given data with this schema.
Args:
data (dict, list): Data to validate against the schema.
strict (bool, optional): if True the validation will automatically flag additional properties. Defaults to False.
Returns:
Iterator: Iterator of ValidationResult
"""
if strict:
validator = self.__get_strict_validator()
else:
validator = self.__get_validator()
has_error = False
for err in validator.iter_errors(data):
has_error = True
self.add_validation_error(err.message, absolute_path=list(err.absolute_path))
if not has_error:
self.add_validation_pass()
return self.get_results()
def validate_to_dict(self, data, strict=False):
"""Return a list of ValidationResult objects.
These are generated with the validate() function in dict() format instead of as a Python Object.
Args:
data (dict, list): Data to validate against the schema.
strict (bool, optional): if True the validation will automatically flag additional properties. Defaults to False.
Returns:
list of dictionnaries containing the results.
"""
return [
result.dict(exclude_unset=True, exclude_none=True) for result in self.validate(data=data, strict=strict)
]
def __get_validator(self):
"""Return the validator for this schema, create if it doesn't exist already.
Returns:
Draft7Validator: The validator for this schema.
"""
if self.validator:
return self.validator
self.validator = Draft7Validator(self.data, format_checker=self.format_checker)
return self.validator
def __get_strict_validator(self):
"""Return a strict version of the Validator, create it if it doesn't exist already.
To create a strict version of the schema, this function adds `additionalProperties` to all objects in the schema.
Returns:
Draft7Validator: Validator for this schema in strict mode.
"""
# TODO Currently the function is only modifying the top level object, need to add that to all objects recursively
if self.strict_validator:
return self.strict_validator
# Create a copy if the schema first and modify it to insert `additionalProperties`
schema = copy.deepcopy(self.data)
if schema.get("additionalProperties", False) is not False:
print(f"{schema['$id']}: Overriding existing additionalProperties: {schema['additionalProperties']}")
schema["additionalProperties"] = False
# TODO This should be recursive, e.g. all sub-objects, currently it only goes one level deep, look in jsonschema for utilitiies
for prop_name, prop in schema.get("properties", {}).items():
items = prop.get("items", {})
if items.get("type") == "object":
if items.get("additionalProperties", False) is not False:
print(
f"{schema['$id']}: Overriding item {prop_name}.additionalProperties: {items['additionalProperties']}"
)
items["additionalProperties"] = False
self.strict_validator = Draft7Validator(schema, format_checker=self.format_checker)
return self.strict_validator
def check_if_valid(self):
"""Check if the schema definition is valid against JsonSchema draft7.
Returns:
List[ValidationResult]: A list of validation result objects.
"""
validator = Draft7Validator(self.v7_schema, format_checker=self.format_checker)
results = []
has_error = False
for err in validator.iter_errors(self.data):
has_error = True
results.append(
ValidationResult(
schema_id=self.id,
result=RESULT_FAIL,
message=err.message,
absolute_path=list(err.absolute_path),
instance_type="SCHEMA",
instance_name=self.id,
instance_location="",
)
)
if not has_error:
results.append(
ValidationResult(
schema_id=self.id,
result=RESULT_PASS,
instance_type="SCHEMA",
instance_name=self.id,
instance_location="",
)
)
return results
|
/schema_enforcer-1.2.2.tar.gz/schema_enforcer-1.2.2/schema_enforcer/schemas/jsonschema.py
| 0.685634 | 0.183667 |
jsonschema.py
|
pypi
|
# pylint: disable=no-member, too-few-public-methods
# See PEP585 (https://www.python.org/dev/peps/pep-0585/)
from __future__ import annotations
import pkgutil
import inspect
import jmespath
from schema_enforcer.validation import ValidationResult
class BaseValidation:
"""Base class for Validation classes."""
def __init__(self):
"""Base init for all validation classes."""
self._results: list[ValidationResult] = []
def add_validation_error(self, message: str, **kwargs):
"""Add validator error to results.
Args:
message (str): error message
kwargs (optional): additional arguments to add to ValidationResult when required
"""
self._results.append(ValidationResult(result="FAIL", schema_id=self.id, message=message, **kwargs))
def add_validation_pass(self, **kwargs):
"""Add validator pass to results.
Args:
kwargs (optional): additional arguments to add to ValidationResult when required
"""
self._results.append(ValidationResult(result="PASS", schema_id=self.id, **kwargs))
def get_results(self) -> list[ValidationResult]:
"""Return all validation results for this validator."""
if not self._results:
self._results.append(ValidationResult(result="PASS", schema_id=self.id))
return self._results
def clear_results(self):
"""Reset results for validator instance."""
self._results = []
def validate(self, data: dict, strict: bool):
"""Required function for custom validator.
Args:
data (dict): variables to be validated by validator
strict (bool): true when --strict cli option is used to request strict validation (if provided)
Returns:
None
Use add_validation_error and add_validation_pass to report results.
"""
raise NotImplementedError
class JmesPathModelValidation(BaseValidation):
"""Base class for JmesPathModelValidation classes."""
def validate(self, data: dict, strict: bool): # pylint: disable=W0613
"""Validate data using custom jmespath validator plugin."""
operators = {
"gt": lambda r, v: int(r) > int(v),
"gte": lambda r, v: int(r) >= int(v),
"eq": lambda r, v: r == v,
"lt": lambda r, v: int(r) < int(v),
"lte": lambda r, v: int(r) <= int(v),
"contains": lambda r, v: v in r,
}
lhs = jmespath.search(self.left, data)
valid = True
if lhs:
# Check rhs for compiled jmespath expression
if isinstance(self.right, jmespath.parser.ParsedResult):
rhs = self.right.search(data)
else:
rhs = self.right
valid = operators[self.operator](lhs, rhs)
if not valid:
self.add_validation_error(self.error)
def is_validator(obj) -> bool:
"""Returns True if the object is a BaseValidation or JmesPathModelValidation subclass."""
try:
return issubclass(obj, BaseValidation) and obj not in (JmesPathModelValidation, BaseValidation)
except TypeError:
return False
def load_validators(validator_path: str) -> dict[str, BaseValidation]:
"""Load all validator plugins from validator_path."""
validators = {}
for importer, module_name, _ in pkgutil.iter_modules([validator_path]):
module = importer.find_module(module_name).load_module(module_name)
for name, cls in inspect.getmembers(module, is_validator):
# Default to class name if id doesn't exist
if not hasattr(cls, "id"):
cls.id = name
if cls.id in validators:
print(
f"Unable to load the validator {cls.id}, there is already a validator with the same name ({name})."
)
else:
validators[cls.id] = cls()
return validators
|
/schema_enforcer-1.2.2.tar.gz/schema_enforcer-1.2.2/schema_enforcer/schemas/validator.py
| 0.865835 | 0.21819 |
validator.py
|
pypi
|
import os
import sys
import json
import jsonref
from termcolor import colored
from rich.console import Console
from rich.table import Table
from schema_enforcer.utils import load_file, find_file, find_files, dump_data_to_yaml
from schema_enforcer.validation import ValidationResult, RESULT_PASS, RESULT_FAIL
from schema_enforcer.exceptions import SchemaNotDefined, InvalidJSONSchema
from schema_enforcer.utils import error, warn
from schema_enforcer.schemas.jsonschema import JsonSchema
from schema_enforcer.schemas.validator import load_validators
class SchemaManager:
"""The SchemaManager class is designed to load and organaized all the schemas."""
def __init__(self, config):
"""Initialize the SchemaManager and search for all schema files in the schema_directories.
Args:
config (Config): Instance of Config object returned by schema_enforcer.config.load() method.
"""
self.schemas = {}
self.config = config
full_schema_dir = f"{config.main_directory}/{config.schema_directory}/"
files = find_files(
file_extensions=[".yaml", ".yml", ".json"],
search_directories=[full_schema_dir],
excluded_filenames=config.schema_file_exclude_filenames,
return_dir=True,
)
# For each schema file, determine the absolute path to the directory
# Create and save a JsonSchema object for each file
for root, filename in files:
root = os.path.realpath(root)
schema = self.create_schema_from_file(root, filename)
self.schemas[schema.get_id()] = schema
# Load validators
validators = load_validators(config.validator_directory)
self.schemas.update(validators)
def create_schema_from_file(self, root, filename):
"""Create a new JsonSchema object for a given file.
Load the content from disk and resolve all JSONRef within the schema file.
Args:
root (string): Absolute location of the file in the filesystem.
filename (string): Name of the file.
Returns:
JsonSchema: JsonSchema object newly created.
"""
file_data = load_file(os.path.join(root, filename))
# TODO Find the type of Schema based on the Type, currently only jsonschema is supported
# schema_type = "jsonschema"
base_uri = f"file:{root}/"
schema_full = jsonref.JsonRef.replace_refs(file_data, base_uri=base_uri, jsonschema=True, loader=load_file)
schema = JsonSchema(schema=schema_full, filename=filename, root=root)
# Only add valid jsonschema files and raise an exception if an invalid file is found
valid = all((result.passed() for result in schema.check_if_valid()))
if not valid:
raise InvalidJSONSchema(schema)
return schema
def iter_schemas(self):
"""Return an iterator of all schemas in the SchemaManager.
Returns:
Iterator: Iterator of all schemas in K,v format (key, value).
"""
return self.schemas.items()
def print_schemas_list(self):
"""Print the list of all schemas to the cli.
To avoid very long location string, dynamically replace the current dir with a dot.
"""
console = Console()
table = Table(show_header=True, header_style="bold cyan")
current_dir = os.getcwd()
table.add_column("Schema ID", style="bright_green")
table.add_column("Type")
table.add_column("Location")
table.add_column("Filename")
for schema_id, schema in self.iter_schemas():
table.add_row(schema_id, schema.schematype, schema.root.replace(current_dir, "."), schema.filename)
console.print(table)
def dump_schema(self, schema_id=None):
"""Dump schema with references resolved.
Dumps all schemas or a single schema represented by schema_id.
Args:
schema_id (str): The unique identifier of a schema.
Returns: None
"""
if schema_id:
schema = self.schemas.get(schema_id, None)
if schema is None:
raise ValueError(f"Could not find schema ID {schema_id}")
print(json.dumps(schema.data, indent=2))
else:
for _, schema in self.iter_schemas():
print(json.dumps(schema.data, indent=2))
def test_schemas(self):
"""Validate all schemas pass the tests defined for them.
For each schema, 3 set of tests will be potentially executed.
- schema must be Draft7 valid.
- Valid tests must pass.
- Invalid tests must pass.
"""
error_exists = False
for schema_id, schema in self.iter_schemas():
schema_valid = schema.check_if_valid()
valid_results = self.test_schema_valid(schema_id)
invalid_results = self.test_schema_invalid(schema_id)
for result in schema_valid + valid_results + invalid_results:
if not result.passed():
error_exists = True
result.print()
if not error_exists:
print(colored("ALL SCHEMAS ARE VALID", "green"))
def test_schema_valid(self, schema_id, strict=False):
"""Execute all valid tests for a given schema.
Args:
schema_id (str): The unique identifier of a schema.
Returns:
list of ValidationResult.
"""
schema = self.schemas[schema_id]
valid_test_dir = self._get_test_dir_absolute(test_type="valid", schema_id=schema_id)
valid_files = find_files(
file_extensions=[".yaml", ".yml", ".json"],
search_directories=[valid_test_dir],
excluded_filenames=[],
return_dir=True,
)
results = []
for root, filename in valid_files:
test_data = load_file(os.path.join(root, filename))
for result in schema.validate(test_data, strict=strict):
result.instance_name = filename
result.instance_location = root
result.instance_type = "TEST"
results.append(result)
return results
def test_schema_invalid(self, schema_id): # pylint: disable=too-many-locals
"""Execute all invalid tests for a given schema.
- Acquire structured data to be validated against a given schema. Do this by searching for a file named
"data.yml", "data.yaml", or "data.json" within a directory of hierarchy
"./<test_directory>/<schema_id>/invalid/"
- Acquire results expected after data is validated against a giveh schema. Do this by searching for a file
named "results.yml", "results.yaml", or "results.json" within a directory of hierarchy
"./<test_directory>/<schema_id>/results/"
- Validate expected results match actual results of data after it is checked for adherence to schema.
Args:
schema_id (str): The unique identifier of a schema.
Returns:
list of ValidationResult objects.
"""
schema = self.schemas.get(schema_id, None)
if schema is None:
raise ValueError(f"Could not find schema ID {schema_id}")
invalid_test_dir = self._get_test_dir_absolute(test_type="invalid", schema_id=schema_id)
test_dirs = next(os.walk(invalid_test_dir))[1]
results = []
for test_dir in test_dirs:
schema.clear_results()
data_file_path = os.path.join(invalid_test_dir, test_dir, "data")
data_file = find_file(data_file_path)
expected_results_file_path = os.path.join(invalid_test_dir, test_dir, "results")
expected_results_file = find_file(expected_results_file_path)
if not data_file:
warn(f"Could not find data file {data_file_path}. Skipping...")
continue
if not expected_results_file:
warn(f"Could not find expected_results_file {expected_results_file_path}. Skipping...")
continue
data = load_file(data_file)
expected_results = load_file(expected_results_file)
tmp_results = schema.validate_to_dict(data)
# Currently the expected results are using OrderedDict instead of Dict
# the easiest way to remove that is to dump into JSON and convert back into a "normal" dict
expected_results = json.loads(json.dumps(expected_results["results"]))
results_sorted = sorted(tmp_results, key=lambda i: i.get("message", ""))
expected_results_sorted = sorted(expected_results, key=lambda i: i.get("message", ""))
params = {
"schema_id": schema_id,
"instance_type": "TEST",
"instance_name": test_dir,
"instance_location": invalid_test_dir,
}
if results_sorted != expected_results_sorted:
params["result"] = RESULT_FAIL
params[
"message"
] = f"Invalid test results do not match expected test results from {expected_results_file}"
else:
params["result"] = RESULT_PASS
val = ValidationResult(**params)
results.append(val)
return results # [ ValidationResult(**result) for result in results ]
def generate_invalid_tests_expected(self, schema_id):
"""Generate expected invalid test results for a given schema.
Args:
schema_id (str): unique identifier of a schema
"""
# TODO: Refactor this into a method. Exists in multiple places
schema = self.schemas.get(schema_id, None)
if schema is None:
raise ValueError(f"Could not find schema ID {schema_id}")
invalid_test_dir = self._get_test_dir_absolute(test_type="invalid", schema_id=schema_id)
test_dirs = next(os.walk(invalid_test_dir))[1]
# For each test, load the data file, test the data against the schema and save the results
for test_dir in test_dirs:
schema.clear_results()
data_file_path = os.path.join(invalid_test_dir, test_dir, "data")
data_file = find_file(data_file_path)
if not data_file:
warn(f"Could not find data file {data_file_path}")
data = load_file(data_file)
results = schema.validate_to_dict(data)
self._ensure_results_invalid(results, data_file)
result_file = os.path.join(invalid_test_dir, test_dir, "results.yml")
dump_data_to_yaml({"results": results}, result_file)
print(f"Generated/Updated results file: {result_file}")
def validate_schemas_exist(self, schema_ids):
"""Validate that each schema ID in a list of schema IDs exists.
Args:
schema_ids (list): A list of schema IDs, each of which should exist as a schema object.
"""
if not isinstance(schema_ids, list):
raise TypeError("schema_ids argument passed into validate_schemas_exist must be of type list")
for schema_id in schema_ids:
if not self.schemas.get(schema_id, None):
raise SchemaNotDefined(f"Schema ID {schema_id} declared but not defined")
@property
def test_directory(self):
"""Return the path to the main schema test directory."""
return os.path.join(self.config.main_directory, self.config.test_directory)
def _get_test_dir_absolute(self, test_type, schema_id):
"""Get absolute path of directory in which schema unit tests exist.
Args:
test_type (str): Test type. One of "valid" or "invalid"
schema_id (str): Schema ID for which to get test dir absolute path
Returns:
str: Full path of test directory.
"""
if test_type not in ["valid", "invalid"]:
raise ValueError(f"Test type parameter was {test_type}. Must be one of 'valid' or 'invalid'")
if not self.schemas.get(schema_id, None):
raise ValueError(f"Could not find schema ID {schema_id}")
root = os.path.abspath(os.getcwd())
short_schema_id = schema_id.split("/")[1] if "/" in schema_id else schema_id
test_dir = os.path.join(root, self.test_directory, short_schema_id, test_type)
if not os.path.exists(test_dir):
error(f"Tried to search {test_dir} for {test_type} data, but the path does not exist.")
sys.exit(1)
return test_dir
@staticmethod
def _ensure_results_invalid(results, data_file):
"""Ensures each result is schema valid in a list of results data structures.
Args:
results(dict): List of Dicts of results. Each result dict must include a 'result' key of 'PASS' or 'FAIL'
data_file (str): Data file which should be schema invalid
Raises:
error: Raises an error and calls sys.exit(1) if one of the results objects is schema valid.
"""
results_pass_or_fail = [result["result"] for result in results]
if "PASS" in results_pass_or_fail:
error(f"{data_file} is schema valid, but should be schema invalid as it defines an invalid test")
sys.exit(1)
|
/schema_enforcer-1.2.2.tar.gz/schema_enforcer-1.2.2/schema_enforcer/schemas/manager.py
| 0.567457 | 0.21428 |
manager.py
|
pypi
|
import os
import re
import itertools
from pathlib import Path
from schema_enforcer.utils import find_files, load_file
SCHEMA_TAG = "jsonschema"
class InstanceFileManager: # pylint: disable=too-few-public-methods
"""InstanceFileManager."""
def __init__(self, config):
"""Initialize the interface File manager.
The file manager will locate all potential instance files in the search directories.
Args:
config (pydantic.BaseSettings): The Pydantec settings object.
"""
self.instances = []
self.config = config
# Find all instance files
# TODO need to load file extensions from the config
instance_files = find_files(
file_extensions=config.data_file_extensions,
search_directories=config.data_file_search_directories,
excluded_filenames=config.data_file_exclude_filenames,
excluded_directories=[config.main_directory],
return_dir=True,
)
# For each instance file, check if there is a static mapping defined in the config
# Create the InstanceFile object and save it
for root, filename in instance_files:
matches = set()
if filename in config.schema_mapping:
matches.update(config.schema_mapping[filename])
instance = InstanceFile(root=root, filename=filename, matches=matches)
self.instances.append(instance)
def add_matches_by_property_automap(self, schema_manager):
"""Adds schema_ids to matches by automapping top level schema properties to top level keys in instance data.
Args:
schema_manager (schema_enforcer.schemas.manager.SchemaManager): Schema manager oject
"""
for instance in self.instances:
instance.add_matches_by_property_automap(schema_manager)
def print_schema_mapping(self):
"""Print in CLI the matches for all instance files."""
print("{:50} Schema ID".format("Structured Data File")) # pylint: disable=consider-using-f-string
print("-" * 80)
print_strings = []
for instance in self.instances:
filepath = f"{instance.path}/{instance.filename}"
print_strings.append(f"{filepath:50} {sorted(instance.matches)}")
print("\n".join(sorted(print_strings)))
class InstanceFile:
"""Class to manage an instance file."""
def __init__(self, root, filename, matches=None):
"""Initializes InstanceFile object.
Args:
root (string): Absolute path to the directory where the schema file is located.
filename (string): Name of the file.
matches (set, optional): Set of schema IDs that matches with this Instance file. Defaults to None.
"""
self.data = None
self.path = root
self.full_path = os.path.realpath(root)
self.filename = filename
# Internal vars for caching data
self._top_level_properties = set()
if matches:
self.matches = matches
else:
self.matches = set()
self._add_matches_by_decorator()
@property
def top_level_properties(self):
"""Return a list of top level properties in the structured data defined by the data pulled from _get_content.
Returns:
set: Set of the strings of top level properties defined by the data file
"""
if not self._top_level_properties:
content = self._get_content()
self._top_level_properties = set(content.keys())
return self._top_level_properties
def _add_matches_by_decorator(self, content=None):
"""Add matches which declare schema IDs they should adhere to using a decorator comment.
If a line of the form # jsonschema: <schema_id>,<schema_id> is defined in the data file, the
schema IDs will be added to the list of schema IDs the data will be checked for adherence to.
Args:
content (string, optional): Content of the file to analyze. Default to None.
Returns:
set(string): Set of matches (strings of schema_ids) found in the file.
"""
if not content:
content = self._get_content(structured=False)
matches = set()
if SCHEMA_TAG in content:
line_regexp = r"^#.*{0}:\s*(.*)$".format(SCHEMA_TAG) # pylint: disable=consider-using-f-string
match = re.match(line_regexp, content, re.MULTILINE)
if match:
matches = {x.strip() for x in match.group(1).split(",")}
self.matches.update(matches)
def _get_content(self, structured=True):
"""Returns the content of the instance file.
Args:
structured (bool): Return structured data if true. If false returns the string representation of the data
stored in the instance file. Defaults to True.
Returns:
dict, list, or str: File Contents. Dict or list if structured is set to True. Otherwise returns a string.
"""
file_location = os.path.join(self.full_path, self.filename)
if not structured:
return Path(file_location).read_text(encoding="utf-8")
return load_file(file_location)
def add_matches_by_property_automap(self, schema_manager):
"""Adds schema_ids to self.matches by automapping top level schema properties to top level keys in instance data.
Args:
schema_manager (schema_enforcer.schemas.manager.SchemaManager): Schema manager oject
"""
matches = set()
for schema_id, schema_obj in schema_manager.iter_schemas():
if schema_obj.top_level_properties.intersection(self.top_level_properties):
matches.add(schema_id)
self.matches.update(matches)
def validate(self, schema_manager, strict=False):
"""Validate this instance file with all matching schema in the schema manager.
Args:
schema_manager (SchemaManager): A SchemaManager object.
strict (bool, optional): True is the validation should automatically flag unsupported element. Defaults to False.
Returns:
iterator: Iterator of ValidationErrors returned by schema.validate.
"""
# TODO need to add something to check if a schema is missing
# Create new iterator chain to be able to aggregate multiple iterators
errs = itertools.chain()
# Go over all schemas and skip any schema not present in the matches
for schema_id, schema in schema_manager.iter_schemas():
if schema_id not in self.matches:
continue
schema.validate(self._get_content(), strict)
results = schema.get_results()
errs = itertools.chain(errs, results)
schema.clear_results()
return errs
|
/schema_enforcer-1.2.2.tar.gz/schema_enforcer-1.2.2/schema_enforcer/instances/file.py
| 0.606382 | 0.152537 |
file.py
|
pypi
|
# 简介
程序入口的构造工具.
这个基类的设计目的是为了配置化入口的定义.通过继承和覆盖基类中的特定字段和方法来实现入口的参数配置读取.
目前的实现可以依次从指定路径下的json文件,环境变量,命令行参数读取需要的数据.
然后校验是否符合设定的json schema规定的模式,在符合模式后执行注册进去的回调函数.
入口树中可以有中间节点,用于分解复杂命令行参数,中间节点不会执行.
他们将参数传递给下一级节点,直到尾部可以执行为止.
# 特性
+ 根据子类的名字小写构造命令
+ 根据子类的docstring,`epilog字段`和`description字段`自动构造,命令行说明.
+ 根据子类的`schema字段`和`env_prefix字段`自动构造环境变量的读取规则.
+ 根据子类的`default_config_file_paths字段`自动按顺序读取json,yaml格式配置文件中的参数.
+ 根据`schema字段`构造命令行参数和配置校验
+ 使用装饰器`@as_main`注册获取到配置后执行的函数
+ 通过覆写`parse_commandline_args`方法来定义命令行参数的读取
+ 入口节点可以通过方法`regist_sub`注册子节点
# 安装
```bash
pip install schema_entry
```
# 使用介绍
## 动机
`schema_entry`模块提供了一个基类`EntryPoint`用于构造复杂的程序入口.通常我们的程序入口参数有3个途径:
1. 配置文件
2. 环境变量
3. 命令行参数
在docker广泛应用之前可能用的最多的是命令行参数.但在docker大行其道的现在,配置文件(docker config)和环境变量(environment字段)变得更加重要.
随之而来的是参数的校验问题,python标准库`argparse`本身有不错的参数约束能力,但配置文件中的和环境变量中的参数就需要额外校验了.
这个项目的目的是简化定义入口这个非常通用的业务,将代码尽量配置化.
## 使用方法
首先我们来分析下一个入口形式.
通常一个程序的入口可能简单也可能复杂,但无非两种
1. 中间节点,比如`docker stack`, 它本质上并不执行操作,它只是表示要执行的是关于子模块的操作.当单独执行这条命令时实际上它什么都没做,它下面的子命令`git submodule add`这类才是实际可以执行的节点.而我定义这种中间节点单独被执行应该打印其帮助说明文本.
2. 执行节点,比如`docker run`,这种就是`可以执行的节点`.
本模块的基本用法是:
1. 通过继承`EntryPoint`类并覆写其中的字段来定义不同的节点
2. 通过实例化`EntryPoint`的子类并使用其实例方法`regist_subcmd`或者`regist_sub`来定义不同节点的类型和节点的调用顺序
3. 使用`可以执行节点`的实例方法`as_main`(装饰器)来指定不同节点的入口函数.
4. 命令行中按`根节点`到`可以执行节点`的顺序输入构造命令,获取来自配置文件,环境变量,命令行参数中的参数,作为注册入口函数的参数调用入口函数.
### 节点名
我们可以定义`_name`字段为节点命名,如果没有那么节点名则为子类类名的全小写形式.
### 节点的帮助信息
我们可以定义`usage`来定义用法帮助字符串,如果没有定义则会自动构造,中间节点会是`root subcmd ... [subcmd]`;
可执行节点会是`root subcmd ... entry [options]`
### 执行节点
上面说过执行节点的任务有3个:
1. 从配置文件,环境变量,命令行参数获取配置参数
2. [可选]校验配置参数是否符合要求
3. [可选]将配置作为参数引用到程序中.
#### 通过定义`schema字段进行参数校验`
我们可以定义`schema字段`来激活校验功能
```python
class Test_A(EntryPoint):
default_config_file_paths = [
"/test_config.json",
str(Path.home().joinpath(".test_config.json")),
"./test_config.json"
]
schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"a": {
"type": "integer"
}
},
"required": ["a"]
}
```
`EntryPoint`的子类会在解析获得参数后校验参数字典是否符合schema中定义的模式.
当然schema字段也不能乱写,它的规则是json schema的一个子集:
```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"properties": {
"type": "object",
"minProperties": 1,
"additionalProperties": False,
"patternProperties": {
"^\\w+$": {
"oneOf": [
{
"type": "object",
"additionalProperties": False,
"required": ["type"],
"properties": {
"type": {
"type": "string",
"const": "boolean"
},
"default": {
"type": "boolean",
},
"const": {
"type": "string"
},
"description": {
"type": "string"
},
"$comment": {
"type": "string"
},
"title": {
"type": "string",
"pattern": "^[a-b]|[d-z]$"
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": ["type"],
"properties": {
"type": {
"type": "string",
"const": "string"
},
"default": {
"type": "string",
},
"const": {
"type": "string"
},
"enum": {
"type": "array",
"items": {
"type": "string"
}
},
"maxLength": {
"type": "integer",
"minimum": 0
},
"minLength": {
"type": "integer",
"minimum": 0
},
"pattern": {
"type": "string"
},
"format": {
"type": "string"
},
"description": {
"type": "string"
},
"$comment": {
"type": "string"
},
"title": {
"type": "string",
"pattern": r"^[a-b]|[d-z]$"
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": ["type"],
"properties": {
"type": {
"type": "string",
"const": "number"
},
"default": {
"type": "number",
},
"const": {
"type": "number"
},
"enum": {
"type": "array",
"items": {
"type": "number"
}
},
"maximum": {
"type": "number",
},
"exclusiveMaximum": {
"type": "number",
},
"minimum": {
"type": "number",
},
"exclusiveMinimum": {
"type": "number",
},
"description": {
"type": "string"
},
"$comment": {
"type": "string"
},
"title": {
"type": "string",
"pattern": "^[a-b]|[d-z]$"
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": ["type"],
"properties": {
"type": {
"type": "string",
"const": "integer"
},
"default": {
"type": "integer",
},
"const": {
"type": "integer"
},
"enum": {
"type": "array",
"items": {
"type": "integer"
}
},
"maximum": {
"type": "integer",
},
"exclusiveMaximum": {
"type": "integer",
},
"minimum": {
"type": "integer",
},
"exclusiveMinimum": {
"type": "integer",
},
"description": {
"type": "string"
},
"$comment": {
"type": "string"
},
"title": {
"type": "string",
"pattern": "^[a-b]|[d-z]$"
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": ["type"],
"properties": {
"type": {
"type": "string",
"const": "array"
},
"default": {
"type": "array",
"items": {
"type": ["string", "number", "integer"]
}
},
"items": {
"type": "object",
"required": ["type"],
"additionalProperties": false,
"properties": {
"type": {
"type": "string",
"enum": ["string", "number", "integer"]
},
"enum":{
"type": "array"
}
}
},
"description": {
"type": "string"
},
"$comment": {
"type": "string"
},
"title": {
"type": "string",
"pattern": "^[a-b]|[d-z]$"
}
}
}
]
}
}
},
"type": {
"type": "string",
"const": "object"
},
"required": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["properties", "type"]
}
```
简而言之就是:
1. 最外层必须有`properties`和`type`字段且`type`字段必须为`object`,可以有`required`字段
2. 最外层`properties`中的字段名必须是由`数字`,`字母`和`_`组成,
3. 字段类型只能是`string`,`boolean`,`number`,`integer`,`array`之一
4. 字段类型如果为`array`则内部必须要有`items`且`items`中必须有`type`字段,且该`type`字段的值必须为`string`,`number`,`integer`之一
如果我们不想校验,那么可以设置`verify_schema`为`False`强行关闭这个功能.
#### 从定义的schema中获取默认配置
我们在定义schema时可以在`"properties"`字段定义的模式描述中通过`default`字段指定描述字段的默认值
```python
class Test_A(EntryPoint):
schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"a_a": {
"type": "number"
"default": 10.1
}
},
"required": ["a_a"]
}
```
这样即便没有其他输入这个参数也会有这个默认值兜底
#### 从指定配置文件中读取配置
我们可以使用字段`default_config_file_paths`指定从固定的几个路径中读取配置文件,配置文件支持`json`和`yaml`两种格式.
我们也可以通过字段`config_file_only_get_need`定义从配置文件中读取配置的行为(默认为`True`),
当置为`True`时我们只会在配置文件中读取schema中定义的字段,否则则会加载全部字段.
也可以通过设置`load_all_config_file = True`来按设定顺序读取全部预设的配置文件位置
默认配置文件地址是一个列表,会按顺序查找读取,只要找到了满足条件的配置文件就会读取.
```python
from pathlib import Path
from schema_entry import EntryPoint
class Test_A(EntryPoint):
default_config_file_paths = [
"/test_config.json",
str(Path.home().joinpath(".test_config.json")),
"./test_config.json",
"./test_config_other.json"
]
```
##### 指定特定命名的配置文件的解析方式
可以使用`@regist_config_file_parser(config_file_name)`来注册如何解析特定命名的配置文件.这一特性可以更好的定制化配置文件的读取
```python
class Test_AC(EntryPoint):
load_all_config_file = True
default_config_file_paths = [
"./test_config.json",
"./test_config1.json",
"./test_other_config2.json"
]
root = Test_AC()
@root.regist_config_file_parser("test_other_config2.json")
def _1(p: Path) -> Dict[str, Any]:
with open(p) as f:
temp = json.load(f)
return {k.lower(): v for k, v in temp.items()}
```
如果想在定义子类时固定好,也可以定义`_config_file_parser_map:Dict[str,Callable[[Path], Dict[str, Any]]]`
```python
def test_other_config2_parser( p: Path) -> Dict[str, Any]:
with open(p) as f:
temp = json.load(f)
return {k.lower(): v for k, v in temp.items()}
class Test_AC(EntryPoint):
load_all_config_file = True
default_config_file_paths = [
"./test_config.json",
"./test_config1.json",
"./test_other_config2.json"
]
_config_file_parser_map = {
"test_other_config2.json": test_other_config2_parser
}
root = Test_AC()
```
#### 从环境变量中读取配置参数
要从环境变量中读取配置必须设置`schema`字段,`EntryPoint`会按照其中`properties`字段定义的字段范围和字段类型解析环境变量.
环境变量key的规则为`前缀_字段名的大写`.前缀的默认值为`...父节命令节点的父命令节点大写_父节命令节点大写_子命令节点大写`.
我们也可以通过设定`env_prefix`字段来替换默认前缀,替换的前缀依然会被转化为大写.
```python
class Test_A(EntryPoint):
env_prefix = "app"
schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"a_a": {
"type": "number"
}
},
"required": ["a_a"]
}
```
如果我们不希望从环境变量中解析配置,那么也可以设置`parse_env`为`False`
#### 从命令行参数中获取配置参数
当我们定义好`schema`后所有schema中定义好的参数都可以以`--xxxx`的形式从命令行中读取,需要注意schema中定义的字段中`_`会被修改为`-`.
如果定义的字段模式中含有`title`字段,则使用title字段作为命令行缩写即`-x`的形式
这个命令行读取是使用的标准库`argparse`,构造出的解析器中`useage`,`epilog`和`description`会由类中定义的`usage`,`epilog`和docstring决定;`argv`则为传到节点处时剩下的命令行参数(每多一个节点就会从左侧摘掉一个命令行参数).
通常情况下构造的命令行解析器全部都是可选项,如果我们希望指定`schema`中一项是没有`--`的那种配置,那么可以在定义类时指定`argparse_noflag`为想要的字段,如果希望命令行中校验必填项则可以在定义类时指定`argparse_check_required=True`.需要注意如果一个字段被指定为了`noflag`那么它就是必填项了.
```python
class Test_A(EntryPoint):
argparse_noflag = "a"
argparse_check_required=True
schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"a": {
"type": "number"
},
"b": {
"type": "number"
}
},
"required": ["a","b"]
}
```
命令行中默认使用`-c`/`--config`来指定读取配置文件,它的读取行为受上面介绍的从自定义配置文件中读取配置的设置影响.
#### 配置的读取顺序
配置的读取顺序为`schema中定义的default值`->`配置指定的配置文件路径`->`命令行指定的配置文件`->`环境变量`->`命令行参数`,而覆盖顺序则是反过来.
#### 注册入口的执行函数
我们使用实例的装饰器方法`as_main`来实现对执行节点入口函数的注册,注册的入口函数会在解析好参数后执行,其参数就是解析好的`**config`
```python
root = Test_A()
@root.as_main
def main(a,b):
print(a)
print(b)
```
另一种指定入口函数的方法是重写子类的`do_main(self)->None`方法
```python
class Test_A(EntryPoint):
argparse_noflag = "a"
argparse_check_required=True
schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"a": {
"type": "number"
},
"b": {
"type": "number"
}
},
"required": ["a","b"]
}
def do_main(self)->None:
print(self.config)
```
#### 直接从节点对象中获取配置
节点对象的`config`属性会在每次调用时copy一份当前的配置值,config是不可写的.
```python
print(root.config)
```
### 中间节点
中间节点并不能执行程序,它只是用于描述一个范围内的命令集合,因此它的作用就是充当`help`指令.我们定义中间节点并不能执行.但必须有至少一个子节点才是中间节点.因此即便一个节点定义了上面的配置,只要它有子节点就不会按上面的执行流程执行.
利用中间节点我们可以构造出非常复杂的启动命令树.
#### 注册子节点
中间节点的注册有两个接口
+ `regist_subcmd`用于注册一个已经实例化的子节点
```python
class A(EntryPoint):
pass
class B(EntryPoint):
pass
a = A()
b = B()
a.regist_subcmd(b)
```
+ `regist_sub`用于注册一个子节点类,它会返回被注册的节点的一个实例
```python
class A(EntryPoint):
pass
class B(EntryPoint):
pass
a = A()
b =a.regist_sub(B)
```
|
/schema_entry-0.1.5.tar.gz/schema_entry-0.1.5/README.md
| 0.647018 | 0.879871 |
README.md
|
pypi
|
import abc
import argparse
from pathlib import Path
from typing import Callable, Sequence, Dict, Any, Optional, Tuple, List, Union
from mypy_extensions import TypedDict
class ItemType(TypedDict):
type: str
enum: List[Union[int, float, str]]
class PropertyType(TypedDict):
type: str
title: str
description: str
enum: List[Union[int, float, str]]
default: Union[int, float, str, bool]
items: ItemType
class SchemaType(TypedDict):
required: List[str]
type: str
properties: Dict[str, PropertyType]
class EntryPointABC(abc.ABC):
"""程序入口类.
Attributes:
epilog (str): 命令行展示介绍时的epilog部分
usage (str): 命令行展示介绍时的使用方法介绍
parent (Optional["EntryPointABC"]): 入口节点的父节点.Default None
schema (Optional[Dict[str, Any]]): 入口节点的设置需要满足的json schema对应字典.Default None
verify_schema (bool): 获得设置后节点是否校验设置是否满足定义的json schema模式
default_config_file_paths (Sequence[str]): 设置默认的配置文件位置.
config_file_only_get_need (bool): 设置是否只从配置文件中获取schema中定义的配置项
load_all_config_file (bool): 设置的默认配置文件全部加载.
env_prefix (str): 设置环境变量的前缀
parse_env (bool): 展示是否解析环境变量
argparse_check_required (bool): 命令行参数是否解析必填项为必填项
argparse_noflag (Optional[str]): 命令行参数解析哪个字段为无`--`的参数
"""
epilog: str
usage: str
_name: str
parent: Optional["EntryPointABC"]
schema: Optional[SchemaType] # Optional[Dict[str, Union[str, List[str], Dict[str, Dict[str, Any]]]]]
verify_schema: bool
default_config_file_paths: Sequence[str]
config_file_only_get_need: bool
load_all_config_file: bool
env_prefix: Optional[str]
parse_env: bool
argparse_check_required: bool
argparse_noflag: Optional[str]
_subcmds: Dict[str, "EntryPointABC"]
_main: Optional[Callable[..., None]]
_config_file_parser_map: Dict[str, Callable[[Path], Dict[str, Any]]]
_config: Dict[str, Any]
@abc.abstractproperty
def name(self) -> str:
"""实例的名字.
实例名字就是它的构造类名.
"""
@abc.abstractproperty
def prog(self) -> str:
"""命令路径."""
@abc.abstractproperty
def config(self) -> Dict[str, Any]:
"""执行配置.
配置为只读数据.
"""
@abc.abstractmethod
def regist_subcmd(self, subcmd: "EntryPointABC") -> None:
"""注册子命令.
Args:
subcmd (EntryPointABC): 子命令的实例
"""
@abc.abstractmethod
def regist_sub(self, subcmdclz: type, **kwargs: Any) -> "EntryPointABC":
'''注册子命令.
Args:
subcmdclz (EntryPointABC): 子命令的定义类
Returns:
[EntryPointABC]: 注册类的实例
'''
@abc.abstractmethod
def regist_config_file_parser(self, file_name: str) -> Callable[[Callable[[Path], Dict[str, Any]]], Callable[[Path], Dict[str, Any]]]:
'''注册特定配置文件名的解析方式.
Args:
file_name (str): 指定文件名
Returns:
Callable[[Callable[[Path], None]], Callable[[Path], None]]: 注册的解析函数
'''
@abc.abstractmethod
def as_main(self, func: Callable[..., None]) -> Callable[..., None]:
"""注册函数在解析参数成功后执行.
执行顺序按被注册的顺序来.
Args:
func (Callable[[Dict[str,Any]],None]): 待执行的参数.
"""
@abc.abstractmethod
def __call__(self, argv: Sequence[str]) -> None:
"""执行命令.
如果当前的命令节点不是终点(也就是下面还有子命令)则传递参数到下一级;
如果当前节点已经是终点则解析命令行参数,环境变量,指定路径后获取参数,然后构造成配置,并检验是否符合定义的json schema模式.
然后如果通过验证并有注册执行函数的话则执行注册的函数.
Args:
argv (Sequence[str]): [description]
"""
@abc.abstractmethod
def pass_args_to_sub(self, parser: argparse.ArgumentParser, argv: Sequence[str]) -> None:
"""解析复杂命令行参数并将参数传递至下一级."""
@abc.abstractmethod
def parse_commandline_args(self, parser: argparse.ArgumentParser, argv: Sequence[str]) -> Tuple[Dict[str, Any], Dict[str, Any]]:
'''默认端点不会再做命令行解析,如果要做则需要在继承时覆盖此方法.
Args:
parser (argparse.ArgumentParser): 命令行解析对象
argv (Sequence[str]): 待解析的参数列表
Returns:
Tuple[Dict[str, Any], Dict[str, Any]]: 命令行指定配置文件获得配置,命令行其他flag获得的配置
'''
@abc.abstractmethod
def parse_env_args(self) -> Dict[str, Any]:
"""从环境变量中读取配置.
必须设定json schema,且parse_env为True才能从环境变量中读取配置.
程序会读取schema结构,并解析其中的`properties`字段.如果没有定义schema则不会解析环境变量.
如果是列表型的数据,那么使用`,`分隔,如果是object型的数据,那么使用`key:value;key:value`的形式分隔
Returns:
Dict[str,Any]: 环境变量中解析出来的参数.
"""
@abc.abstractmethod
def parse_configfile_args(self) -> Dict[str, Any]:
"""从指定的配置文件队列中构造配置参数.
目前只支持json格式的配置文件.
指定的配置文件路径队列中第一个json格式且存在的配置文件将被读取解析.
一旦读取到了配置后面的路径将被忽略.
Args:
argv (Sequence[str]): 配置的可能路径
Returns:
Dict[str,Any]: 从配置文件中读取到的配置
"""
@abc.abstractmethod
def validat_config(self) -> bool:
"""校验配置.
在定义好schema,解析到config并且verify_schema为True后才会进行校验.
Returns:
bool: 是否通过校验
"""
@abc.abstractmethod
def do_main(self) -> None:
"""执行入口函数."""
@abc.abstractmethod
def parse_args(self, parser: argparse.ArgumentParser, argv: Sequence[str]) -> None:
"""解析获取配置
配置的加载顺序为: 指定路径的配置文件->环境变量->命令行参数
在加载完配置后校验是否满足schema的要求.
Args:
parser (argparse.ArgumentParser): 命令行参数解析器
argv (Sequence[str]): 命令行参数序列
"""
|
/schema_entry-0.1.5.tar.gz/schema_entry-0.1.5/schema_entry/entrypoint_base.py
| 0.70416 | 0.396535 |
entrypoint_base.py
|
pypi
|
import warnings
import argparse
from typing import List, Dict, Any, Optional
from .entrypoint_base import EntryPointABC, PropertyType, ItemType
def _get_parent_tree(c: EntryPointABC, result: List[str]) -> None:
if c.parent:
result.append(c.parent.name)
_get_parent_tree(c.parent, result)
else:
return
def get_parent_tree(c: EntryPointABC) -> List[str]:
"""获取父节点树.
Args:
c (EntryPoint): 节点类
Returns:
List[str]: 父节点树
"""
result_list: List[str] = []
_get_parent_tree(c, result_list)
return list(reversed(result_list))
def parse_value_string_by_schema(schema: Any, value_str: str) -> Any:
"""根据schema的定义解析字符串的值.
Args:
schema (Dict[str, Any]): 描述字符串值的json schema字典.
value_str (str): 待解析的字符串.
Returns:
Any: 字段的值
"""
t = schema.get("type")
if not t:
return value_str
elif t == "string":
return value_str
elif t == "number":
return float(value_str)
elif t == "integer":
return int(value_str)
elif t == "boolean":
value_u = value_str.upper()
return True if value_u == "TRUE" else False
elif t == "array":
item_info = schema.get("items")
if not item_info:
return value_str.split(",")
else:
return [parse_value_string_by_schema(item_info, i) for i in value_str.split(",")]
else:
warnings.warn(f"不支持的数据类型{t}")
return value_str
def _argparse_base_handdler(_type: Any, key: str, schema: PropertyType, parser: argparse.ArgumentParser, *,
required: bool = False, noflag: bool = False) -> argparse.ArgumentParser:
kwargs: Dict[str, Any] = {}
kwargs.update({
"type": _type
})
_enum = schema.get("enum")
if _enum:
kwargs.update({
"choices": _enum
})
_description = schema.get("description")
if _description:
kwargs.update({
"help": _description
})
if required:
kwargs.update({
"required": required
})
if noflag:
parser.add_argument(f"{key}", **kwargs)
else:
if schema.get("title"):
short = schema["title"][0]
parser.add_argument(f"-{short}", f"--{key}", **kwargs)
else:
parser.add_argument(f"--{key}", **kwargs)
return parser
def _argparse_number_handdler(key: str, schema: PropertyType, parser: argparse.ArgumentParser, *,
required: bool = False, noflag: bool = False) -> argparse.ArgumentParser:
return _argparse_base_handdler(float, key, schema, parser, required=required, noflag=noflag)
def _argparse_string_handdler(key: str, schema: PropertyType, parser: argparse.ArgumentParser, *,
required: bool = False, noflag: bool = False) -> argparse.ArgumentParser:
return _argparse_base_handdler(str, key, schema, parser, required=required, noflag=noflag)
def _argparse_integer_handdler(key: str, schema: PropertyType, parser: argparse.ArgumentParser, *,
required: bool = False, noflag: bool = False) -> argparse.ArgumentParser:
return _argparse_base_handdler(int, key, schema, parser, required=required, noflag=noflag)
def _argparse_boolean_handdler(key: str, schema: PropertyType, parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
kwargs: Dict[str, Any] = {}
kwargs.update({
"action": "store_true"
})
_description = schema.get("description")
if _description:
kwargs.update({
"help": _description
})
if schema.get("title"):
short = schema["title"][0]
parser.add_argument(f"-{short}", f"--{key}", **kwargs)
else:
parser.add_argument(f"--{key}", **kwargs)
return parser
def _argparse_array_handdler(key: str, schema: PropertyType, parser: argparse.ArgumentParser, *,
noflag: bool = False) -> argparse.ArgumentParser:
sub_schema: Optional[ItemType] = schema.get("items")
if sub_schema is None:
print("array params must have sub schema items")
return parser
sub_type = sub_schema.get("type")
if sub_type not in ("number", "string", "integer"):
print("array params item type must in number,string,integer")
return parser
kwargs: Dict[str, Any] = {}
if sub_type == "number":
kwargs.update({
"type": float
})
elif sub_type == "string":
kwargs.update({
"type": str
})
elif sub_type == "integer":
kwargs.update({
"type": int
})
_default = schema.get("default")
if _default:
kwargs.update({
"default": _default
})
_description = schema.get("description")
if _description:
kwargs.update({
"help": _description
})
_enum = sub_schema.get("enum")
if _enum:
kwargs.update({
"choices": _enum
})
if noflag:
kwargs.update({
"nargs": "+"
})
parser.add_argument(f"{key}", **kwargs)
else:
kwargs.update({
"action": "append"
})
if schema.get("title"):
short = schema["title"][0]
parser.add_argument(f"-{short}", f"--{key}", **kwargs)
else:
parser.add_argument(f"--{key}", **kwargs)
return parser
def parse_schema_as_cmd(key: str, schema: PropertyType, parser: argparse.ArgumentParser, *,
required: bool = False, noflag: bool = False) -> argparse.ArgumentParser:
"""根据字段的模式解析命令行行为
Args:
key (str): 字段名
schema (PropertyType): 字段的模式
parser (argparse.ArgumentParser): 添加命令行解析的解析器
Returns:
argparse.ArgumentParser: 命令行的解析器
"""
_type = schema.get("type")
if not _type:
return parser
if not noflag:
key = key.replace("_", "-")
if _type == "number":
return _argparse_number_handdler(key, schema, parser, required=required, noflag=noflag)
elif _type == "string":
return _argparse_string_handdler(key, schema, parser, required=required, noflag=noflag)
elif _type == "integer":
return _argparse_integer_handdler(key, schema, parser, required=required, noflag=noflag)
elif _type == "boolean":
return _argparse_boolean_handdler(key, schema, parser)
elif _type == "array":
return _argparse_array_handdler(key, schema, parser, noflag=noflag)
else:
print(f"未支持的类型{_type}")
return parser
|
/schema_entry-0.1.5.tar.gz/schema_entry-0.1.5/schema_entry/utils.py
| 0.707304 | 0.324597 |
utils.py
|
pypi
|
SUPPORT_SCHEMA = {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"properties": {
"type": "object",
"minProperties": 1,
"additionalProperties": False,
"patternProperties": {
r"^\w+$": {
"oneOf": [
{
"type": "object",
"additionalProperties": False,
"required": ["type"],
"properties": {
"type": {
"type": "string",
"const": "boolean"
},
"default": {
"type": "boolean",
},
"const": {
"type": "boolean"
},
"description": {
"type": "string"
},
"$comment": {
"type": "string"
},
"title": {
"type": "string",
"pattern": r"^[a-b]|[d-z]$"
}
}
},
{
"type": "object",
"additionalProperties": False,
"required": ["type"],
"properties": {
"type": {
"type": "string",
"const": "string"
},
"default": {
"type": "string",
},
"const": {
"type": "string"
},
"enum": {
"type": "array",
"items": {
"type": "string"
}
},
"maxLength": {
"type": "integer",
"minimum": 0
},
"minLength": {
"type": "integer",
"minimum": 0
},
"pattern": {
"type": "string"
},
"format": {
"type": "string"
},
"description": {
"type": "string"
},
"$comment": {
"type": "string"
},
"title": {
"type": "string",
"pattern": r"^[a-b]|[d-z]$"
}
}
},
{
"type": "object",
"additionalProperties": False,
"required": ["type"],
"properties": {
"type": {
"type": "string",
"const": "number"
},
"default": {
"type": "number",
},
"const": {
"type": "number"
},
"enum": {
"type": "array",
"items": {
"type": "number"
}
},
"maximum": {
"type": "number",
},
"exclusiveMaximum": {
"type": "number",
},
"minimum": {
"type": "number",
},
"exclusiveMinimum": {
"type": "number",
},
"description": {
"type": "string"
},
"$comment": {
"type": "string"
},
"title": {
"type": "string",
"pattern": r"^[a-b]|[d-z]$"
}
}
},
{
"type": "object",
"additionalProperties": False,
"required": ["type"],
"properties": {
"type": {
"type": "string",
"const": "integer"
},
"default": {
"type": "integer",
},
"const": {
"type": "integer"
},
"enum": {
"type": "array",
"items": {
"type": "integer"
}
},
"maximum": {
"type": "integer",
},
"exclusiveMaximum": {
"type": "integer",
},
"minimum": {
"type": "integer",
},
"exclusiveMinimum": {
"type": "integer",
},
"description": {
"type": "string"
},
"$comment": {
"type": "string"
},
"title": {
"type": "string",
"pattern": r"^[a-b]|[d-z]$"
}
}
},
{
"type": "object",
"additionalProperties": False,
"required": ["type"],
"properties": {
"type": {
"type": "string",
"const": "array"
},
"default": {
"type": "array",
"items": {
"type": ["string", "number", "integer"]
}
},
"items": {
"type": "object",
"required": ["type"],
"additionalProperties":False,
"properties": {
"type": {
"type": "string",
"enum": ["string", "number", "integer"]
},
"enum":{
"type": "array",
"items": {
"type": ["string", "number", "integer"]
}
}
}
},
"description": {
"type": "string"
},
"$comment": {
"type": "string"
},
"title": {
"type": "string",
"pattern": r"^[a-b]|[d-z]$"
}
}
}
]
}
}
},
"type": {
"type": "string",
"const": "object"
},
"required": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": ["properties", "type"]
}
|
/schema_entry-0.1.5.tar.gz/schema_entry-0.1.5/schema_entry/protocol.py
| 0.683947 | 0.381018 |
protocol.py
|
pypi
|
import io
import unicodecsv as csv
from schema_induction.type import Type
from schema_induction.union_type import UnionType
def dump_csv(array, delimiter=','):
f = io.BytesIO()
writer = csv.writer(f, delimiter=delimiter, quoting=csv.QUOTE_ALL)
writer.writerow(array)
return f.getvalue()[:-2].decode('utf-8')
class PrimitiveType(Type):
"""
Represent primitive type such as string, float, int
"""
MAX_N_KEEP_VALUE = 7
def __init__(self, type=None):
if type is None:
self.type = None
else:
self.set_type(type)
# implement using dictionary so we can keep the order
self.possible_values = {}
def set_type(self, type):
assert type in {'float', 'int', 'str', 'bool'}, type
self.type = type
return self
def add_value(self, value):
if len(self.possible_values) > PrimitiveType.MAX_N_KEEP_VALUE:
return self
if value not in self.possible_values:
self.possible_values[value] = 1
return self
def is_mergeable(self, another):
"""
test if two PRIMITIVE TYPEs can be merged
:param another: PrimitiveType
:return: bool
"""
if not isinstance(another, PrimitiveType):
return False
return self.type == another.type or {self.type, another.type} == {'float', 'int'}
def optimize(self):
"""
@inherit
"""
return self
def merge(self, another):
"""
@inherit
"""
if isinstance(another, PrimitiveType):
if self.type == another.type:
for value in another.possible_values.keys():
self.add_value(value)
return self
if {self.type, another.type} == {'float', 'int'}:
self.type = 'float'
return self
return UnionType().add(self).add(another)
def to_string(self, shift=0, indent=0):
"""
@inherit
"""
if len(self.possible_values) < PrimitiveType.MAX_N_KEEP_VALUE:
string = '%s{%s}' % (self.type, dump_csv(list(self.possible_values.keys())))
return string
else:
return self.type
class NoneType(Type):
"""
Represent null
"""
def optimize(self):
"""
@inherit
"""
return self
def merge(self, another):
"""
@inherit
"""
if isinstance(another, NoneType):
return self
return another.merge(self)
def to_string(self, shift=0, indent=0):
"""
@inherit
"""
return "null"
|
/schema_induction-1.1.7-py3-none-any.whl/schema_induction/primitive_type.py
| 0.605333 | 0.376279 |
primitive_type.py
|
pypi
|
from pyspark.sql.types import (
BooleanType,
BooleanType,
DoubleType,
IntegerType,
StringType,
StructField,
StructType,
)
def bronze_machine_raw():
"""
fill in
"""
schema = StructType(
[
StructField("N8j2", DoubleType(), True),
StructField("42mj", DoubleType(), True),
StructField("6tk3", BooleanType(), True),
]
)
return schema
def silver_machine_raw():
"""
fill in
"""
schema = StructType(
[
StructField("N8j2", DoubleType(), True),
StructField("42mj", DoubleType(), True),
StructField("6tk3", BooleanType(), True),
StructField("engine_type", StringType(), True),
]
)
return schema
def bronze_sap_bseg():
"""
fill in
"""
schema = StructType(
[
StructField("MANDT", StringType(), True),
StructField("BUKRS", StringType(), True),
StructField("BELNR", StringType(), True),
StructField("GJAHR", DoubleType(), True),
StructField("BUZEI", DoubleType(), True),
]
)
return schema
def bronze_sales():
"""
fill in
"""
schema = StructType(
[
StructField("ORDERNUMBER", IntegerType(), True),
StructField("SALE", DoubleType(), True),
StructField("ORDERDATE", StringType(), True),
StructField("STATUS", BooleanType(), True),
StructField("CUSTOMERNAME", StringType(), True),
StructField("ADDRESSLINE", StringType(), True),
StructField("CITY", StringType(), True),
StructField("STATE", StringType(), True),
StructField("STORE", StringType(), True),
]
)
return schema
def gold_sales():
"""
fill in
"""
schema = StructType(
[
StructField("CUSTOMERNAME", StringType(), True),
StructField("AVG", DoubleType(), True),
StructField("TOTAL", DoubleType(), True),
]
)
return schema
|
/schema_jobs-0.1.15-py3-none-any.whl/schema_jobs/jobs/utility/schema/schemas.py
| 0.794505 | 0.413714 |
schemas.py
|
pypi
|
Overview
========
Schema is a general algorithm for integrating heterogeneous data
modalities. While it has been specially designed for multi-modal
single-cell biological datasets, it should work in other multi-modal
contexts too.
.. image:: ../_static/Schema-Overview-v2.png
:width: 648
:alt: 'Overview of Schema'
Schema is designed for single-cell assays where multiple modalities have
been *simultaneously* measured for each cell. For example, this could be
simultaneously-asayed ("paired") scRNA-seq and scATAC-seq data, or a
spatial-transcriptomics dataset (e.g. 10x Visium, Slideseq or
STARmap). Schema can also be used with just a scRNA-seq dataset where some
per-cell metadata is available (e.g., cell age, donor information, batch
ID etc.). With this data, Schema can help perform analyses like:
* Characterize cells that look similar transcriptionally but differ
epigenetically.
* Improve cell-type inference by combining RNA-seq and ATAC-seq data.
* In spatially-resolved single-cell data, identify differentially
expressed genes (DEGs) specific to a spatial pattern.
* **Improved visualizations**: tune t-SNE or UMAP plots to more clearly
arrange cells along a desired manifold.
* Simultaneously account for batch effects while also integrating
other modalities.
Intuition
~~~~~~~~~
To integrate multi-modal data, Schema takes a `metric learning`_
approach. Each modality is interepreted as a multi-dimensional space, with
observations mapped to points in it (**B** in figure above). We associate
a distance metric with each modality: the metric reflects what it means
for cells to be similar under that modality. For example, Euclidean
distances between L2-normalized expression vectors are a proxy for
coexpression. Across the three graphs in the figure (**B**), the dashed and
dotted lines indicate distances between the same pairs of
observations.
Schema learns a new distance metric between points, informed
jointly by all the modalities. In Schema, we start by designating one
high-confidence modality as the *primary* (i.e., reference) and the
remaining modalities as *secondary*--- we've found scRNA-seq to typically
be a good choice for the primary modality. Schema transforms the
primary-modality space by scaling each of its dimensions so that the
distances in the transformed space have a higher (or lower, if desired!)
correlation with corresponding distances in the secondary modalities
(**C,D** in the figure above). You can choose any distance metric for the
secondary modalities, though the primary modality's metric needs to be Euclidean.
The primary modality can be pre-transformed by
a `PCA`_ or `NMF`_ transformation so that the scaling occurs in this latter
space; this can often be more powerful because the major directions of variance are
now axis-aligned and hence can be scaled independently.
Advantages
~~~~~~~~~~
In generating a shared-space representation, Schema is similar to
statistical approaches like CCA (canonical correlation analysis) and
deep-learning methods like autoencoders (which map multiple
representations into a shared latent space). Each of these approaches offers a
different set of trade-offs. Schema, for instance, requires the output
space to be a linear transformation of the primary modality. Doing so
allows it to offer the following advantages:
* **Interpretability**: Schema identifies which features of the primary
modality were important in maximizing its agreement with the secondary
modalities. If the features corresponded to genes (or principal components),
this can directly be interpreted in terms of gene importances.
* **Regularization**: single-cell data can be sparse and noisy. As we
discuss in our `paper`_, unconstrained approaches like CCA and
autoencoders seek to maximize the alignment between modalities without
any other considerations. In doing so, they can pick up on artifacts
rather than true biology. A key feature of Schema is its
regularization: if enforces a limit on the distortion of the primary
modality, making sure that the final result remains biologically
informative.
* **Speed and flexibility**: Schema is a based on a fast quadratic
programming approach that allows for substantial flexibility in the
number of secondary modalities supported and their relative weights. Also, arbitrary
distance metrics (i.e., kernels) are supported for the secondary modalities.
Quick Start
~~~~~~~~~~~
Install via pip
.. code-block:: bash
pip install schema_learn
**Example**: correlate gene expression with developmental stage. We demonstrate use with Anndata objects here.
.. code-block:: Python
import schema
adata = schema.datasets.fly_brain() # adata has scRNA-seq data & cell age
sqp = schema.SchemaQP( min_desired_corr=0.99, # require 99% agreement with original scRNA-seq distances
params= {'decomposition_model': 'nmf', 'num_top_components': 20} )
#correlate the gene expression with the 'age' parameter
mod_X = sqp.fit_transform( adata.X, # primary modality
[ adata.obs['age'] ], # list of secondary modalities
[ 'numeric' ] ) # datatypes of secondary modalities
gene_wts = sqp.feature_weights() # get a ranking of gene wts important to the alignment
Paper & Code
~~~~~~~~~~~~
Schema is described in the paper *Schema: metric learning enables
interpretable synthesis of heterogeneous single-cell modalities*
(http://doi.org/10.1101/834549)
Source code available at: https://github.com/rs239/schema
.. _metric learning: https://en.wikipedia.org/wiki/Similarity_learning#Metric_learning
.. _paper: https://doi.org/10.1101/834549
.. _PCA: https://en.wikipedia.org/wiki/Principal_component_analysis
.. _NMF: https://en.wikipedia.org/wiki/Non-negative_matrix_factorization
|
/schema_learn-0.1.5.5.tar.gz/schema_learn-0.1.5.5/docs/source/overview.rst
| 0.969389 | 0.838217 |
overview.rst
|
pypi
|
Data Integration Examples
=======
API-usage Examples
~~~~~~~~~~~~~~
*Note*: The code snippets below show how Schema could be used for hypothetical datasets and illustrates the API usage. In the next sections (`Paired RNA-seq and ATAC-seq`_, `Paired-Tag`_) and in `Visualization`_, we describe worked examples where we also provide the dataset to try things on. We are working to add more datasets.
**Example** Correlate gene expression 1) positively with ATAC-Seq data and 2) negatively with Batch information.
.. code-block:: Python
atac_50d = sklearn.decomposition.TruncatedSVD(50).fit_transform( atac_cnts_sp_matrix)
sqp = SchemaQP(min_corr=0.9)
# df is a pd.DataFrame, srs is a pd.Series, -1 means try to disagree
mod_X = sqp.fit_transform( df_gene_exp, # gene expression dataframe: rows=cells, cols=genes
[ atac_50d, batch_id], # batch_info can be a pd.Series or np.array. rows=cells
[ 'feature_vector', 'categorical'],
[ 1, -1]) # maximize combination of (agreement with ATAC-seq + disagreement with batch_id)
gene_wts = sqp.feature_weights() # get gene importances
**Example** Correlate gene expression with three secondary modalities.
.. code-block:: Python
sqp = SchemaQP(min_corr = 0.9) # lower than the default, allowing greater distortion of the primary modality
sqp.fit( adata.X,
[ adata.obs['col1'], adata.obs['col2'], adata.obsm['Matrix1'] ],
[ "categorical", "numeric", "feature_vector"]) # data types of the three modalities
mod_X = sqp.transform( adata.X) # transform
gene_wts = sqp.feature_weights() # get gene importances
Paired RNA-seq and ATAC-seq
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here, we integrate simultaneously assayed RNA- and ATAC-seq data from `Cao et al.'s`_ sci-CAR study of mouse kidney cells. Specifically, we'll try to do better cell-type inference by considering both RNA-seq and ATAC-seq data simultaneously. The original study has ground-truth labels for most of the cell types, allowing us to benchmark automatically-computed clusters (generated by Leiden clustering here). As we'll show, a key challenge here is that the ATAC-seq data is very sparse and noisy. Naively incorporating it with RNA-seq can actually be counter-productive--- the joint clustering from a naive approach can actually have a *lower* overlap with the ground truth labels than if we were to just use RNA-seq-based clustering.
*Note*: This example involves generating Leiden clusters; you will need to install the *igraph* and *leidenalg* Python packages if you want to use them:
.. code-block:: bash
pip install igraph
pip install leidenalg
Let's start by getting the data. We have preprocessed the original dataset, done some basic cleanup, and put it into an AnnData object that you can download. Please remember to also cite the original study if you use this dataset.
.. code-block:: Python
import schema
adata = schema.datasets.scicar_mouse_kidney()
print(adata.shape, adata.uns['atac.X'].shape)
print(adata.uns.keys())
As you see, we have stored the ATAC data (as a sparse numpy matrix) in the .uns slots of the anndata object. Also look at the *adata.obs* dataframe which has t-SNE coordinates, ground-truth cell type names (as assigned by Cao et al.) and cluster colors etc. You'll notice that some cells don't have ground truth assignments. When evaluating, we'll skip those.
To use the ATAC-seq data, we reduce its dimensionality to 50. Instead of PCA, we apply *TruncatedSVD* since the ATAC counts matrix is sparse.
.. code-block:: Python
svd2 = sklearn.decomposition.TruncatedSVD(n_components= 50, random_state = 17)
H2 = svd2.fit_transform(adata.uns["atac.X"])
Next, we run Schema. We choose RNA-seq as the primary modality because 1) it has lower noise than ATAC-seq, and 2) we want to investigate which of its features (i.e., genes) are important during the integration. We will first perform a NMF transformation on the RNA-seq data. For the secondary modality, we'll use the dimensionality-reduced ATAC-seq. We require a positive correlation between the two (`secondary_data_wt_list = [1]` below). **Importantly, we force Schema to generate a low-distortation transformation** : the correlation of distances between original RNA-seq space and the transformed space, `min_desired_corr` is required to be >99%. This low-distortion capability of Schema is crucial here, as we'll demonstrate.
In the `params` settings below, the number of randomly sampled point-pairs has been bumped up to 5M (from default=2M). It helps with the accuracy and doesn't cost too much computationally. We also turned off `do_whiten` (default=1, i.e., true). When `do_whiten=1`, Schema first rescales the PCA/NMF transformation so that each axis has unit variance; typically, doing so is "nice" from a theoretical/statistical perspective. But it can interfere with downstream analyses (e.g., Leiden clustering here).
.. code-block:: Python
sqp99 = schema.SchemaQP(0.99, mode='affine', params= {"decomposition_model":"nmf",
"num_top_components":50,
"do_whiten": 0,
"dist_npairs": 5000000})
dz99 = sqp99.fit_transform(adata.X, [H2], ['feature_vector'], [1])
Let's look at the feature weights. Since we ran the code in 'affine' mode, the raw weights from the quadratic program will correspond to the 50 NMF factors. Three of these factors seem to stand out; most other weights are quite low.
.. code-block:: Python
plt.plot(sqp99._wts)
.. image:: ../_static/schema_atacrna_demo_wts1.png
:width: 300
Schema offers a helper function to convert these NMF (or PCA) feature weights to gene weights. The function offers a few ways of doing so, but the default is to simply average the loadings across the top-k factors:
.. code-block:: Python
v99 = sqp99.feature_weights("top-k-loading", 3)
Let's do a dotplot to visualize how the expression of these genes varies by cell name. We plot the top 10 genes by importance here.
.. code-block:: Python
dfv99 = pd.DataFrame({"gene": adata.var_names, "v":v99}).sort_values("v", ascending=False).reset_index(drop=True)
sc.pl.dotplot(adata, dfv99.gene.head(10).tolist(),'cell_name_short', figsize=(8,6))
As you'll notice, theese gene seem to be differentially expressed in PT cells, PBA and Ki-67+ cells. Essentially, these are cell types where ATAC-seq data was most informative. As we'll see shortly, it is preciely in these cells where Schema is able to offer the biggest improvement.
.. image:: ../_static/schema_atacrna_demo_dotplot1.png
:width: 500
For a comparison later, let's also do a Schema run without a strong distortion control. Below, we set the `min_desired_corr` parameter to 0.10 (i.e., 10%). Thus, the ATAC-seq data will get to influence the transformation a lot more.
.. code-block:: Python
sqp10 = schema.SchemaQP(0.10, mode='affine', params= {"decomposition_model":"nmf",
"num_top_components":50,
"do_whiten": 0,
"dist_npairs": 5000000})
dz10 = sqp10.fit_transform(adata.X, [H2], ['feature_vector'], [1])
Finally, let's do Leiden clustering of the RNA-seq, ATAC-seq, and the two Schema runs. We'll compare the cluster assignments to the ground truth cell labels. Intuitively, by combining RNA-seq and ATAC-seq, one should be able to get a more biologically accurate clustering. We visually evaluate the clusterings below; in the paper, we've supplemented this with more quantitative estimates.
.. code-block:: Python
import schema.utils
fcluster = schema.utils.get_leiden_clustering #feel free to try your own clustering algo
ld_cluster_rna = fcluster(sqp99._decomp_mdl.transform(adata.X.todense()))
ld_cluster_atac = fcluster(H2)
ld_cluster_sqp99 = fcluster(dz99)
ld_cluster_sqp10 = fcluster(dz10)
.. code-block:: Python
x = adata.obs.tsne_1
y = adata.obs.tsne_2
idx = adata.obs.rgb.apply(lambda s: isinstance(s,str) and '#' in s).values.tolist() #skip nan cells
fig, axs = plt.subplots(3,2, figsize=(10,15))
axs[0][0].scatter(x[idx], y[idx], c=adata.obs.rgb.values[idx], s=1)
axs[0][0].set_title('Ground Truth')
axs[0][1].scatter(x[idx], y[idx], c=adata.obs.rgb.values[idx], s=1, alpha=0.1)
axs[0][1].set_title('Ground Truth Labels')
for c in np.unique(adata.obs.cell_name_short[idx]):
if c=='nan': continue
cx,cy = x[adata.obs.cell_name_short==c].mean(), y[adata.obs.cell_name_short==c].mean()
axs[0][1].text(cx,cy,c,fontsize=10)
axs[1][0].scatter(x[idx], y[idx], c=ld_cluster_rna[idx], cmap='tab20b', s=1)
axs[1][0].set_title('RNA-seq')
axs[1][1].scatter(x[idx], y[idx], c=ld_cluster_atac[idx], cmap='tab20b', s=1)
axs[1][1].set_title('ATAC-seq')
axs[2][0].scatter(x[idx], y[idx], c=ld_cluster_sqp99[idx], cmap='tab20b', s=1)
axs[2][0].set_title('Schema-99%')
axs[2][1].scatter(x[idx], y[idx], c=ld_cluster_sqp10[idx], cmap='tab20b', s=1)
axs[2][1].set_title('Schema-10%')
for ax in np.ravel(axs): ax.axis('off')
Below, we show the figures in a 3x2 panel of t-SNE plots. In the first row, the left panel shows the cells colored by ground-truth cell types; the right panel is basically the same but lists the cell types explicitly. The next row shows cells colored by RNA- or ATAC-only clustering. Notice how noisy the ATAC-only clustering is! This is not a bug in our analysis-- less than 0.3% of ATAC count matrix entries are non-zero and the sparsity of the ATAC data makes it difficult to produce high-quality cell type estimates.
The third row shows cells colored by Schema-based clustering at 99% (left) and 10% (right) `min_desired_corr` thresholds. With Schema at a low-distortion setting (i.e., `min_desired_corr = 99%`), notice that PT cells and Ki-67+ cells, circled in red, are getting more correctly classified now. This improvement of the Schema-implied clustering over the RNA-seq-only clustering can be quantified by measuring the overlap with ground truth cell grouping, as we do in the paper.
**This is a key strength of Schema** --- even with a modality that is sparse and noisy (like ATAC-seq here), it can nonetheless extract something of value from the noisy modality because the constraint on distortion of the primary modality acts as a regularization. This is also why we recommend that your highest-confidence modality be set as the primary. Lastly as demonstration, if we relax the distortion constraint by setting `min_desired_corr = 10%`, you'll notice that the noise of ATAC-seq data does swamp out the RNA-seq signal. With an unconstrained approach (e.g., CCA or some deep learning approaches), this ends being a major challenge.
.. image:: ../_static/schema_atacrna_demo_tsne1.png
:width: 600
Paired-Tag
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here we synthesize simultaneously assayed RNA-seq, ATAC-seq and histone-modification data at a single-cell resolution, from the Paired-Tag protocol described in `Zhu et al.’s study`_ of adult mouse frontal cortex and hippocampus (Nature Methods, 2021). This is a fascinating dataset with five different histone modifications assayed separately (3 repressors and 2 activators), in addition to RNA-seq and ATAC-seq. As in the original study, we consider each of the histone modifications as a separate modality, implying a hepta-modal assay!
Interestingly, though, the modalities are available only in pairwise combinations with RNA-seq: some cells were assayed for H3K4me1 & RNA-seq while another set of cells provided ATAC-seq & RNA-seq data, and so on. Here’s the overall distribution of non-RNA-seq modalities across 64,849 cells.
.. image:: ../_static/schema_paired-tag_data-dist.png
:width: 300
This organization of data might be tricky to integrate with a method which expects *each* modality to be available for *all* cells and has difficulty accomodating partial coverage of some modalities. Of course, you could always fall back to an integrative approach that treats each modality’s cell population as independent, but then you miss out on the simultaneously-multimodal aspect of this data.
With Schema, you can have your cake and eat it too! We do 6 two-way integrations (RNA-seq as the primary modality against each of the other modalities) using the subsets of cells available in each case. Schema’s interpretable and linear framework makes it easy to combine these. Once Schema computes the optimal transformation of RNA-seq that aligns it with, say, ATAC-seq, we apply that transformation to the entire RNA-seq dataset, including cells that do *not* have ATAC-seq data.
Such full-dataset extensions of the pairwise syntheses can then be stacked together. Doing Leiden clustering on the result would enable us to infer cell types by integrating information from all modalities. As we will show below, Schema's synthesis helps improve the quality of cell type inference over what you could get just from RNA-seq. Similarly for feature selection, Schema's computed feature weights for each two-way synthesis can be averaged to get the genes important to the overall synthesis. In a completely automated fashion and without any knowledge of tissue’s source or biology, we’ll find that the genes Schema identifies as important turn out to be very relevant to neuronal function and disease. Ready for more?
First, you will need the data. The original is available on GEO (`GSE152020`_) but the individual modalities are huge (e.g., the ATAC-seq peak-counts are in a 14,095 x 2,443,832 sparse matrix!). This is not unusual--- epigenetic modalites are typically very sparse (we discuss why this matters in `Paired RNA-seq and ATAC-seq`_). As a preprocessing step, we performed singular value decompositions (SVD) of these modalities and also reduced the RNA-seq data to its 4,000 highly variable genes. An AnnData object with this preprocessing is available here (please remember to also cite the original study if you use this dataset) :
.. code-block:: bash
wget http://cb.csail.mit.edu/cb/schema/adata_dimreduced_paired-tag.pkl
Let's load it in:
.. code-block:: Python
import schema, pickle, anndata, sklearn.metrics
import scanpy as sc
# you may need to change the file location as appopriate to your setup
adata = pickle.load(open("adata_dimreduced_paired-tag.pkl", "rb"))
print (adata.shape,
[(c, adata.uns['SVD_'+c].shape) for c in adata.uns['sec_modalities']])
As you see, we have stored the 50-dimensional SVDs of the secondary modalities in the :code:`.uns` slots of the anndata object. Also look at the :code:`adata.obs` dataframe which has UMAP coordinates, ground-truth cell type names (as assigned by Zhu et al.) etc.
We now do Schema runs for the 6 two-way modality combinations, with RNA-seq as the primary in each run. Each run will also store the transformation on the entire 64,849-cell RNA-seq dataset and also store the gene importances.
.. code-block:: Python
d_rna = adata.X.todense()
desc2transforms = {}
for desc in adata.uns['sec_modalities']:
print(desc)
# we mostly stick with the default settings, explicitly listed here for clarity
sqp = schema.SchemaQP(0.99, mode='affine', params= {"decomposition_model": 'pca',
"num_top_components":50,
"do_whiten": 0, # this is different from default
"dist_npairs": 5000000})
# extract the relevant subset
idx1 = adata.obs['rowidx'][adata.uns["SVD_"+desc].index]
prim_d = d_rna[idx1,:]
sec_d = adata.uns["SVD_"+desc].values
print(len(idx1), prim_d.shape, sec_d.shape)
sqp.fit(prim_d, [sec_d], ['feature_vector'], [1]) # fit on the idx1 subset...
dz = sqp.transform(d_rna) # ...then transform the full RNA-seq dataset
desc2transforms[desc] = (sqp, dz, idx1, sqp.feature_weights(k=3))
**Cell type inference:**: In each of the 6 runs above, :code:`dz` is a 64,849 x 50 matrix. We can horizontally stack these matrices for a 64,849 x 300 matrix that represents the transformation of RNA-seq data informed simultaneously by all 6 secondary modalities.
.. code-block:: Python
a6Xpca = np.hstack([dz for _,dz,_,_ in desc2transforms.values()])
adata_schema = anndata.AnnData(X=a6Xpca, obs=adata.obs)
print (adata_schema.shape)
We then perform Leiden clustering on the original and transformed data, computing the overlap with expert marker-gene-based annotation by Zhu et al.
.. code-block:: Python
# original
sc.pp.pca(adata)
sc.pp.neighbors(adata)
sc.tl.leiden(adata)
# Schema-transformed
# since Schema had already done PCA before it transformed, let's stick with its raw output
sc.pp.neighbors(adata_schema, use_rep='X')
sc.tl.leiden(adata_schema)
# we'll do plots etc. with the original AnnData object
adata.obs['leiden_schema'] = adata_schema.obs['leiden'].values
# compute overlap with manual cell type annotations
ari_orig = sklearn.metrics.adjusted_rand_score(adata.obs.Annotation, adata.obs.leiden)
ari_schema= sklearn.metrics.adjusted_rand_score(adata.obs.Annotation, adata.obs.leiden_schema)
print ("ARI: Orig: {} With Schema: {}".format( ari_orig, ari_schema))
As you can see, the ARI with Schema improved from 0.437 (using only RNA-seq) to 0.446 (using all modalities). Single-cell epigenetic modalities are very sparse, making it difficult to distinguish signal from noise. However, Schema's constrained approach allows it to extract signal from these secondary modalities nonetheless, a task which has otherwise been challenging (see the related discussion in our `paper`_ or in `Paired RNA-seq and ATAC-seq`_).
Before we plot these clusters, we'll relabel the Schema-based Leiden clusters to match the labeling of RNA-seq only Leiden clusters; this will make their color schemes consistent. You will need to install the Python package *munkres* (:code:`pip install munkres`) for the related computation.
.. code-block:: Python
import munkres
list1 = adata.obs['leiden'].astype(int).tolist()
list2 = adata.obs['leiden_schema'].astype(int).tolist()
contmat = sklearn.metrics.cluster.contingency_matrix(list1, list2)
map21 = dict(munkres.Munkres().compute(contmat.max() - contmat))
adata.obs['leiden_schema_relabeled'] = [str(map21[a]) for a in list2]
adata.obs['Schema_reassign'] = [('Same' if (map21[a]==a) else 'Different') for a in list2]
for c in ['Annotation','Annot2', 'leiden', 'leiden_schema_relabeled', 'Schema_reassign']:
sc.pl.umap(adata, color=c)
.. image:: ../_static/schema_paired-tag_umap-row1.png
:width: 800
.. image:: ../_static/schema_paired-tag_umap-row2.png
:width: 650
It's also interesting to identify cells where the cluster assignments changed after multi-modal synthesis. As you can see, it's only in certain cell types where the epigenetic data suggests a different clustering than the primary RNA-seq modality.
.. image:: ../_static/schema_paired-tag_umap-row3.png
:width: 300
**Gene set identification:** The feature importances output by Schema here identify the genes whose expression variations best agree with epigenetic variations in these tissues. We first aggregate the feature importances across the 6 two-ways runs:
.. code-block:: Python
df_genes = pd.DataFrame({'gene': adata.var.symbol})
for desc, (_,_,_,wts) in desc2transforms.items():
df_genes[desc] = wts
df_genes['avg_wt'] = df_genes.iloc[:,1:].mean(axis=1)
df_genes = df_genes.sort_values('avg_wt', ascending=False).reset_index(drop=True)
gene_list = df_genes.gene.values
sc.pl.umap(adata, color= gene_list[:6], gene_symbols='symbol', color_map='plasma', frameon=False, ncols=3)
.. image:: ../_static/schema_paired-tag_gene_plots.png
:width: 800
Many of the top genes identified by Schema (e.g., `Erbb4`_, `Npas3`_, `Zbtb20`_, `Luzp2`_) are known to be relevant to neuronal function or disease. Note that all of this fell out of the synthesis directly--- we didn't do any differential expression analysis against an external background or provide the method some other indication that the data is from brain tissue.
We also did a GO enrichment analysis (via `Gorilla`_) of the top 100 genes by Schema weight. Here are the significant hits (FDR q-val < 0.1). Again, most GO terms relate to neuronal development, activity, and communication:
.. csv-table:: GO Enrichment of Top Schema-identified genes
:file: ../_static/schema_paired-tag_go-annot.csv
:widths: 20, 80
:header-rows: 0
.. _Visualization: https://schema-multimodal.readthedocs.io/en/latest/visualization/index.html#ageing-fly-brain
.. _Cao et al.'s: https://science.sciencemag.org/content/361/6409/1380/
.. _paper: https://genomebiology.biomedcentral.com/articles/10.1186/s13059-021-02313-2
.. _Erbb4: https://www.ncbi.nlm.nih.gov/gene/2066
.. _Npas3: https://www.ncbi.nlm.nih.gov/gene/64067
.. _Zbtb20: https://www.ncbi.nlm.nih.gov/gene/26137
.. _Luzp2: https://www.ncbi.nlm.nih.gov/gene/338645
.. _Gorilla: http://cbl-gorilla.cs.technion.ac.il/
.. _Zhu et al.’s study: https://www.nature.com/articles/s41592-021-01060-3
.. _GSE152020: https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE152020
|
/schema_learn-0.1.5.5.tar.gz/schema_learn-0.1.5.5/docs/source/recipes/index.rst
| 0.919054 | 0.943764 |
index.rst
|
pypi
|
# Schema
Schema is a general algorithm for integrating heterogeneous data
modalities. It has been specially designed for multi-modal
single-cell biological datasets, but should work in other contexts too.
This version is based on a Quadratic Programming framework.
It is described in the paper
["*Schema: A general framework for integrating heterogeneous single-cell modalities*"](https://www.biorxiv.org/content/10.1101/834549v1).
The module provides a class SchemaQP that offers a sklearn type fit+transform API for affine
transformations of input datasets such that the transformed data is in agreement
with all the input datasets.
## Getting Started
The examples provided here are also available in the examples/Schema_demo.ipynb notebook
### Installation
```
pip install schema_learn
```
### Schema: A simple example
For the examples below, you'll also need scanpy (`pip install scanpy`).
We use `fast_tsne` below for visualization, but feel free to use your favorite tool.
#### Sample data
The data in the examples below is from the paper below; we thank the authors for making it available:
* Tasic et al. [*Shared and distinct transcriptomic cell types across neocortical areas*.](https://www.nature.com/articles/s41586-018-0654-5) Nature. 2018 Nov;563(7729):72-78. doi:10.1038/s41586-018-0654-5
We make available a processed subset of the data for demonstration and analysis.
Linux shell commands to get this data:
```
wget http://schema.csail.mit.edu/datasets/Schema_demo_Tasic2018.h5ad.gz
gunzip Schema_demo_Tasic2018.h5ad.gz
```
In Python, set the `DATASET_DIR` variable to the folder containing this file.
The processing of raw data here broadly followed the steps in Kobak & Berens
* https://www.biorxiv.org/content/10.1101/453449v1
The gene expression data has been count-normalized and log-transformed. Load with the commands
```python
import scanpy as sc
adata = sc.read(DATASET_DIR + "/" + "Schema_demo_Tasic2018.h5ad")
```
#### Sample Schema usage
Import Schema as:
```python
from schema import SchemaQP
afx = SchemaQP(0.75) # min_desired_corr is the only required argument.
dx_pca = afx.fit_transform(adata.X, # primary dataset
[adata.obs["class"].values], # just one secondary dataset
['categorical'] # has labels, i.e., is a categorical datatype
)
```
This uses PCA as the change-of-basis transform; requires a min corr of 0.75 between the
primary dataset (gene expression) and the transformed dataset; and maximizes
correlation between the primary dataset and the secondary dataset, supercluster
(i.e. higher-level clusters) labels produced during Tasic et al.'s hierarchical clustering.
### More Schema examples
* In all of what follows, the primary dataset is gene expression. The secondary datasets are 1) cluster IDs; and/or 2) cell-type "class" variables which correspond to superclusters (i.e. higher-level clusters) in the Tasic et al. paper.
#### With NMF (Non-negative Matrix Factorization) as change-of-basis, a different min_desired_corr, and two secondary datasets
```python
afx = SchemaQP(0.6, params= {"decomposition_model": "nmf", "num_top_components": 50})
dx_nmf = afx.fit_transform(adata.X,
[adata.obs["class"].values, adata.obs.cluster_id.values], # two secondary datasets
['categorical', 'categorical'], # both are labels
[10, 1] # relative wts
)
```
#### Now let's do something unusual. Perturb the data so it *disagrees* with cluster ids
```python
afx = SchemaQP(0.97, # Notice that we bumped up the min_desired_corr so the perturbation is limited
params = {"decomposition_model": "nmf", "num_top_components": 50})
dx_perturb = afx.fit_transform(adata.X,
[adata.obs.cluster_id.values], # could have used both secondary datasets, but one's fine here
['categorical'],
[-1] # This is key: we are putting a negative wt on the correlation
)
```
#### Recommendations for parameter settings
* `min_desired_corr` and `w_max_to_avg` are the names for the hyperparameters $s_1$ and $\bar{w}$ from our paper
* *min_desired_corr*: at first, you should try a range of values for `min_desired_corr` (e.g., 0.99, 0.90, 0.50). This will give you a sense of what might work well for your data; after this, you can progressively narrow down your range. In typical use-cases, high `min_desired_corr` values (> 0.80) work best.
* *w_max_to_avg*: start by keeping this constraint very loose. This ensures that `min_desired_corr` remains the binding constraint. Later, as you get a better sense for `min_desired_corr` values, you can experiment with this too. A value of 100 is pretty high and should work well in the beginning.
#### tSNE plots of the baseline and Schema transforms
```python
fig = plt.figure(constrained_layout=True, figsize=(8,2), dpi=300)
tmps = {}
for i,p in enumerate([("Original", adata.X),
("PCA1 (pos corr)", dx_pca),
("NMF (pos corr)", dx_nmf),
("Perturb (neg corr)", dx_perturb)
]):
titlestr, dx1 = p
ax = fig.add_subplot(1,4,i+1, frameon=False)
tmps[titlestr] = dy = fast_tsne(dx1, seed=42)
ax = plt.gca()
ax.set_aspect('equal', adjustable='datalim')
ax.scatter(dy[:,0], dy[:,1], s=1, color=adata.obs['cluster_color'])
ax.set_title(titlestr)
ax.axis("off")
```
## API
### Constructor
Initializes the `SchemaQP` object
#### Parameters
`min_desired_corr`: `float` in [0,1)
The minimum desired correlation between squared L2 distances in the transformed space
and distances in the original space.
RECOMMENDED VALUES: At first, you should try a range of values (e.g., 0.99, 0.90, 0.50).
This will give you a sense of what might work well for your data.
After this, you can progressively narrow down your range.
In typical use-cases of large biological datasets,
high values (> 0.80) will probably work best.
`w_max_to_avg`: `float` >1, optional (default: 100)
Sets the upper-bound on the ratio of w's largest element to w's avg element.
Making it large will allow for more severe transformations.
RECOMMENDED VALUES: Start by keeping this constraint very loose; the default value (100) does
this, ensuring that min_desired_corr remains the binding constraint.
Later, as you get a better sense for the right min_desired_corr values
for your data, you can experiment with this too.
To really constrain this, set it in the (1-5] range, depending on
how many features you have.
`params`: `dict` of key-value pairs, optional (see defaults below)
Additional configuration parameters.
Here are the important ones:
* decomposition_model: "pca" or "nmf" (default=pca)
* num_top_components: (default=50) number of PCA (or NMF) components to use
when mode=="affine".
You can ignore the rest on your first pass; the default values are pretty reasonable:
* dist_npairs: (default=2000000). How many pt-pairs to use for computing pairwise distances
value=None means compute exhaustively over all n*(n-1)/2 pt-pairs. Not recommended for n>5000.
Otherwise, the given number of pt-pairs is sampled randomly. The sampling is done
in a way in which each point will be represented roughly equally.
* scale_mode_uses_standard_scaler: 1 or 0 (default=0), apply the standard scaler
in the scaling mode
* do_whiten: 1 or 0 (default=1). When mode=="affine", should the change-of-basis loadings
be made 1-variance?
`mode`: {`'affine'`, `'scale'`}, optional (default: `'affine'`)
Whether to perform a general affine transformation or just a scaling transformation
* 'scale' does scaling transformations only.
* 'affine' first does a mapping to PCA or NMF space (you can specify n_components)
It then does a scaling transform in that space and then maps everything back to the
regular space, the final space being an affine transformation
RECOMMENDED VALUES: 'affine' is the default, which uses PCA or NMF to do the change-of-basis.
You'll want 'scale' only in one of two cases:
1) You have some features on which you directly want Schema to compute
feature-weights.
2) You want to do a change-of-basis transform other PCA or NMF. If so, you will
need to do that yourself and then call SchemaQP with the transformed
primary dataset with mode='scale'.
#### Returns
A SchemaQP object on which you can call fit(...), transform(...) or fit_transform(....).
### Fit
Given the primary dataset 'd' and a list of secondary datasets, fit a linear transformation (d*) of
'd' such that the correlation between squared pairwise distances in d* and those in secondary datasets
is maximized while the correlation between the primary dataset d and d* remains above
min_desired_corr
#### Parameters
`d`: A numpy 2-d `array`
The primary dataset (e.g. scanpy/anndata's .X).
The rows are observations (e.g., cells) and the cols are variables (e.g., gene expression).
The default distance measure computed is L2: sum((point1-point2)**2). See d0_dist_transform.
`secondary_data_val_list`: `list` of 1-d or 2-d numpy `array`s, each with same number of rows as `d`
The secondary datasets you want to align the primary data towards.
Columns in scanpy's .obs variables work well (just remember to use .values)
`secondary_data_type_list`: `list` of `string`s, each value in {'numeric','feature_vector','categorical'}
The list's length should match the length of secondary_data_val_list
* 'numeric' means you're giving one floating-pt value for each obs.
The default distance measure is L2: (point1-point2)**2
* 'feature_vector' means you're giving some multi-dimensional representation for each obs.
The default distance measure is L2: sum((point1-point2)**2)
* 'categorical' means that you are providing label information that should be compared for equality.
The default distance measure is: 1*(val1!=val2)
`secondary_data_wt_list`: `list` of `float`s, optional (default: `None`)
User-specified wts for each dataset. If 'None', the wts are 1.
If specified, the list's length should match the length of secondary_data_wt_list
NOTE: you can try to get a mapping that *disagrees* with a dataset_info instead of *agreeing*.
To do so, pass in a negative number (e.g., -1) here. This works even if you have just one secondary
dataset
`d0`: A 1-d or 2-d numpy array, same number of rows as 'd', optional (default: `None`)
An alternative representation of the primary dataset.
HANDLE WITH CARE! Most likely, you don't need this parameter.
This is useful if you want to provide the primary dataset in two forms: one for transforming and
another one for computing pairwise distances to use in the QP constraint; if so, 'd' is used for the
former, while 'd0' is used for the latter
`d0_dist_transform`: a function that takes a non-negative float as input and
returns a non-negative float, optional (default: `None`)
HANDLE WITH CARE! Most likely, you don't need this parameter.
The transformation to apply on d or d0's L2 distances before using them for correlations.
`secondary_data_dist_transform`: `list` of functions, each taking a non-negative float and
returning a non-negative float, optional (default: `None`)
HANDLE WITH CARE! Most likely, you don't need this parameter.
The transformations to apply on secondary dataset's L2 distances before using them for correlations.
If specified, the length of the list should match that of secondary_data_val_list
#### Returns:
None
### Transform
Given a dataset `d`, apply the fitted transform to it
#### Parameters
`d`: a numpy 2-d array with same number of columns as primary dataset `d` in the fit(...)
The rows are observations (e.g., cells) and the cols are variables (e.g., gene expression).
#### Returns
a 2-d numpy array with the same shape as `d`
|
/schema_learn-0.1.5.5.tar.gz/schema_learn-0.1.5.5/deprecated/old_readme.md
| 0.780244 | 0.990505 |
old_readme.md
|
pypi
|
from schema import SchemaQP
from anndata import AnnData
import numpy as np
import scanpy as sc
from .process import load_names
def load_meta(fname):
age, strain = [], []
with open(fname) as f:
f.readline() # Consume header.
for line in f:
fields = line.rstrip().split()
age.append(int(fields[4]))
strain.append(fields[3])
return np.array(age), np.array(strain)
if __name__ == '__main__':
[ X ], [ genes ], _ = load_names([ 'data/fly_brain/GSE107451' ], norm=False)
age, strain = load_meta('data/fly_brain/GSE107451/annotation.tsv')
# Only analyze wild-type strain.
adata = AnnData(X[strain == 'DGRP-551'])
adata.var['gene_symbols'] = genes
adata.obs['age'] = age[strain == 'DGRP-551']
# No Schema transformation.
sc.pp.pca(adata)
sc.tl.tsne(adata, n_pcs=50)
sc.pl.tsne(adata, color='age', color_map='coolwarm',
save='_flybrain_regular.png')
sc.pp.neighbors(adata, n_neighbors=15)
sc.tl.umap(adata)
sc.pl.umap(adata, color='age', color_map='coolwarm',
save='_flybrain_regular.png')
# Schema transformation to include age.
schema_corrs = [ 0.9999, 0.999, 0.99, 0.9, 0.7, 0.5 ]
for schema_corr in schema_corrs:
sqp = SchemaQP(
min_desired_corr=schema_corr,
w_max_to_avg=100,
params={
'decomposition_model': 'nmf',
'num_top_components': 20,
},
)
X = sqp.fit_transform(
adata.X,
[ adata.obs['age'].values, ],
[ 'numeric', ],
[ 1, ]
)
sdata = AnnData(X)
sdata.obs['age'] = age[strain == 'DGRP-551']
sc.tl.tsne(sdata)
sc.pl.tsne(sdata, color='age', color_map='coolwarm',
save='_flybrain_schema_corr{}_w100.png'.format(schema_corr))
sc.pp.neighbors(sdata, n_neighbors=15)
sc.tl.umap(sdata)
sc.pl.umap(sdata, color='age', color_map='coolwarm',
save='_flybrain_schema{}_w100.png'.format(schema_corr))
|
/schema_learn-0.1.5.5.tar.gz/schema_learn-0.1.5.5/deprecated/old_examples/fly_brain/fly_brain.py
| 0.634204 | 0.388444 |
fly_brain.py
|
pypi
|
def validate_type_model_errors(types):
"""
Validate a user type model's types
:param dict types: The map of user type name to user type model
:returns: The list of type name, member name, and error message tuples
"""
errors = []
# Check each user type
for type_name, user_type in types.items():
# Struct?
if 'struct' in user_type:
struct = user_type['struct']
# Inconsistent type name?
if type_name != struct['name']:
errors.append((type_name, None, f'Inconsistent type name {struct["name"]!r} for {type_name!r}'))
# Check base types
if 'bases' in struct:
is_union = struct.get('union', False)
for base_name in struct['bases']:
invalid_base = True
base_user_type = _get_effective_user_type(types, base_name)
if base_user_type is not None and 'struct' in base_user_type:
if is_union == base_user_type['struct'].get('union', False):
invalid_base = False
if invalid_base:
errors.append((type_name, None, f'Invalid struct base type {base_name!r}'))
# Iterate the members
try:
members = set()
for member in _get_struct_members(types, struct, set()):
member_name = member['name']
# Duplicate member?
if member_name not in members:
members.add(member_name)
else:
errors.append((type_name, member_name, f'Redefinition of {type_name!r} member {member_name!r}'))
# Check member type and attributes
_validate_type_model_type(errors, types, member['type'], member.get('attr'), struct['name'], member['name'])
except ValueError:
errors.append((type_name, None, f'Circular base type detected for type {type_name!r}'))
# Enum?
elif 'enum' in user_type:
enum = user_type['enum']
# Inconsistent type name?
if type_name != enum['name']:
errors.append((type_name, None, f'Inconsistent type name {enum["name"]!r} for {type_name!r}'))
# Check base types
if 'bases' in enum:
for base_name in enum['bases']:
base_user_type = _get_effective_user_type(types, base_name)
if base_user_type is None or 'enum' not in base_user_type:
errors.append((type_name, None, f'Invalid enum base type {base_name!r}'))
# Get the enumeration values
try:
values = set()
for value in _get_enum_values(types, enum, set()):
value_name = value['name']
# Duplicate value?
if value_name not in values:
values.add(value_name)
else:
errors.append((type_name, value_name, f'Redefinition of {type_name!r} value {value_name!r}'))
except ValueError:
errors.append((type_name, None, f'Circular base type detected for type {type_name!r}'))
# Typedef?
elif 'typedef' in user_type:
typedef = user_type['typedef']
# Inconsistent type name?
if type_name != typedef['name']:
errors.append((type_name, None, f'Inconsistent type name {typedef["name"]!r} for {type_name!r}'))
# Check the type and its attributes
_validate_type_model_type(errors, types, typedef['type'], typedef.get('attr'), type_name, None)
# Action?
elif 'action' in user_type: # pragma: no branch
action = user_type['action']
# Inconsistent type name?
if type_name != action['name']:
errors.append((type_name, None, f'Inconsistent type name {action["name"]!r} for {type_name!r}'))
# Check action section types
for section in ('path', 'query', 'input', 'output', 'errors'):
if section in action:
section_type_name = action[section]
# Check the section type
_validate_type_model_type(errors, types, {'user': section_type_name}, None, type_name, None)
# Compute effective input member counts
member_sections = {}
for section in ('path', 'query', 'input'):
if section in action:
section_type_name = action[section]
if section_type_name in types:
section_user_type = _get_effective_user_type(types, section_type_name)
if section_user_type is not None and 'struct' in section_user_type:
section_struct = section_user_type['struct']
# Get the section struct's members and count member occurrences
try:
for member in _get_struct_members(types, section_struct, set()):
member_name = member['name']
if member_name not in member_sections:
member_sections[member_name] = []
member_sections[member_name].append(section_struct['name'])
except ValueError:
pass
# Check for duplicate input members
for member_name, member_section_names in member_sections.items():
if len(member_section_names) > 1:
for section_type in member_section_names:
errors.append((section_type, member_name, f'Redefinition of {section_type!r} member {member_name!r}'))
return errors
def _get_effective_type(types, type_):
if 'user' in type_ and type_['user'] in types:
user_type = types[type_['user']]
if 'typedef' in user_type:
return _get_effective_type(types, user_type['typedef']['type'])
return type_
def _get_effective_user_type(types, user_type_name):
user_type = types.get(user_type_name)
if user_type is not None and 'typedef' in user_type:
type_effective = _get_effective_type(types, user_type['typedef']['type'])
if 'user' not in type_effective:
return None
return types.get(type_effective['user'])
return user_type
def _get_struct_members(types, struct, visited=None):
yield from _get_type_items(types, struct, visited, 'struct', 'members')
def _get_enum_values(types, enum, visited=None):
yield from _get_type_items(types, enum, visited, 'enum', 'values')
def _get_type_items(types, type_, visited, def_name, member_name):
if 'bases' in type_:
for base in type_['bases']:
user_type = _get_effective_user_type(types, base)
if user_type is not None and def_name in user_type:
user_type_name = user_type[def_name]['name']
if user_type_name not in visited:
visited.add(user_type_name)
yield from _get_type_items(types, user_type[def_name], visited, def_name, member_name)
else:
raise ValueError()
if member_name in type_:
yield from type_[member_name]
# Map of attribute struct member name to attribute description
_ATTR_TO_TEXT = {
'eq': '==',
'lt': '<',
'lte': '<=',
'gt': '>',
'gte': '>=',
'lenEq': 'len ==',
'lenLT': 'len <',
'lenLTE': 'len <=',
'lenGT': 'len >',
'lenGTE': 'len >='
}
# Map of type name to valid attribute set
_TYPE_TO_ALLOWED_ATTR = {
'float': set(['eq', 'lt', 'lte', 'gt', 'gte']),
'int': set(['eq', 'lt', 'lte', 'gt', 'gte']),
'string': set(['lenEq', 'lenLT', 'lenLTE', 'lenGT', 'lenGTE']),
'array': set(['lenEq', 'lenLT', 'lenLTE', 'lenGT', 'lenGTE']),
'dict': set(['lenEq', 'lenLT', 'lenLTE', 'lenGT', 'lenGTE'])
}
def _validate_type_model_type(errors, types, type_, attr, type_name, member_name):
# Helper function to push an error tuple
def error(message):
if member_name is not None:
errors.append((type_name, member_name, f'{message} from {type_name!r} member {member_name!r}'))
else:
errors.append((type_name, None, f'{message} from {type_name!r}'))
# Array?
if 'array' in type_:
array = type_['array']
# Check the type and its attributes
array_type = _get_effective_type(types, array['type'])
_validate_type_model_type(errors, types, array_type, array.get('attr'), type_name, member_name)
# Dict?
elif 'dict' in type_:
dict_ = type_['dict']
# Check the type and its attributes
dict_type = _get_effective_type(types, dict_['type'])
_validate_type_model_type(errors, types, dict_type, dict_.get('attr'), type_name, member_name)
# Check the dict key type and its attributes
if 'keyType' in dict_:
dict_key_type = _get_effective_type(types, dict_['keyType'])
_validate_type_model_type(errors, types, dict_key_type, dict_.get('keyAttr'), type_name, member_name)
# Valid dict key type (string or enum)
if not ('builtin' in dict_key_type and dict_key_type['builtin'] == 'string') and \
not ('user' in dict_key_type and dict_key_type['user'] in types and 'enum' in types[dict_key_type['user']]):
error('Invalid dictionary key type')
# User type?
elif 'user' in type_:
user_type_name = type_['user']
# Unknown user type?
if user_type_name not in types:
error(f'Unknown type {user_type_name!r}')
else:
user_type = types[user_type_name]
# Action type references not allowed
if 'action' in user_type:
error(f'Invalid reference to action {user_type_name!r}')
# Any not-allowed attributes?
if attr is not None:
type_effective = _get_effective_type(types, type_)
type_key = next(iter(type_effective.keys()), None)
allowed_attr = _TYPE_TO_ALLOWED_ATTR.get(type_effective[type_key] if type_key == 'builtin' else type_key)
disallowed_attr = set(attr)
disallowed_attr.discard('nullable')
if allowed_attr is not None:
disallowed_attr -= allowed_attr
if disallowed_attr:
for attr_key in disallowed_attr:
attr_value = f'{attr[attr_key]:.6f}'.rstrip('0').rstrip('.')
attr_text = f'{_ATTR_TO_TEXT[attr_key]} {attr_value}'
error(f'Invalid attribute {attr_text!r}')
|
/schema_markdown-1.2.6-py3-none-any.whl/schema_markdown/schema_util.py
| 0.625209 | 0.155495 |
schema_util.py
|
pypi
|
from datetime import date, datetime, timezone
from decimal import Decimal
from math import isnan, isinf
from uuid import UUID
from .schema_util import validate_type_model_errors
from .type_model import TYPE_MODEL
def get_referenced_types(types, type_name, referenced_types=None):
"""
Get a type's referenced type model
:param dict types: The `type model <https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types'>`__
:param str type_name: The type name
:param dict referenced_types: An optional map of referenced user type name to user type
:returns: The referenced `type model <https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types'>`__
"""
return _get_referenced_types(types, {'user': type_name}, referenced_types)
def _get_referenced_types(types, type_, referenced_types=None):
# Create the referenced types dict, if necessary
if referenced_types is None:
referenced_types = {}
# Array?
if 'array' in type_:
array = type_['array']
_get_referenced_types(types, array['type'], referenced_types)
# Dict?
elif 'dict' in type_:
dict_ = type_['dict']
_get_referenced_types(types, dict_['type'], referenced_types)
if 'keyType' in dict_:
_get_referenced_types(types, dict_['keyType'], referenced_types)
# User type?
elif 'user' in type_:
type_name = type_['user']
# Already encountered?
if type_name not in referenced_types:
user_type = types[type_name]
referenced_types[type_name] = user_type
# Struct?
if 'struct' in user_type:
struct = user_type['struct']
if 'bases' in struct:
for base in struct['bases']:
_get_referenced_types(types, {'user': base}, referenced_types)
for member in get_struct_members(types, struct):
_get_referenced_types(types, member['type'], referenced_types)
# Enum
elif 'enum' in user_type:
enum = user_type['enum']
if 'bases' in enum:
for base in enum['bases']:
_get_referenced_types(types, {'user': base}, referenced_types)
# Typedef?
elif 'typedef' in user_type:
typedef = user_type['typedef']
_get_referenced_types(types, typedef['type'], referenced_types)
# Action?
elif 'action' in user_type: # pragma: no branch
action = user_type['action']
if 'path' in action:
_get_referenced_types(types, {'user': action['path']}, referenced_types)
if 'query' in action:
_get_referenced_types(types, {'user': action['query']}, referenced_types)
if 'input' in action:
_get_referenced_types(types, {'user': action['input']}, referenced_types)
if 'output' in action:
_get_referenced_types(types, {'user': action['output']}, referenced_types)
if 'errors' in action:
_get_referenced_types(types, {'user': action['errors']}, referenced_types)
return referenced_types
class ValidationError(Exception):
"""
schema-markdown type model validation error
:param str msg: The error message
:param member_fqn: The fully qualified member name or None
:type member_fqn: str or None
"""
__slots__ = ('member',)
def __init__(self, msg, member_fqn=None):
super().__init__(msg)
#: The fully qualified member name or None
self.member = member_fqn
def validate_type(types, type_name, value, member_fqn=None):
"""
Type-validate a value using the schema-markdown user type model. Container values are duplicated
since some member types are transformed during validation.
:param dict types: The `type model <https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types'>`__
:param str type_name: The type name
:param object value: The value object to validate
:param str member_fqn: The fully-qualified member name
:returns: The validated, transformed value object
:raises ValidationError: A validation error occurred
"""
if type_name not in types:
raise ValidationError(f"Unknown type {type_name!r}")
return _validate_type(types, {'user': type_name}, value, member_fqn)
def _validate_type(types, type_, value, member_fqn=None):
value_new = value
# Built-in type?
if 'builtin' in type_:
builtin = type_['builtin']
# string?
if builtin == 'string':
# Not a string?
if not isinstance(value, str):
raise _member_error(type_, value, member_fqn)
# int?
elif builtin == 'int':
# Convert string, float, or Decimal?
if isinstance(value, (str, float, Decimal)):
try:
value_new = int(value)
if not isinstance(value, str) and value_new != value:
raise ValueError()
except ValueError:
raise _member_error(type_, value, member_fqn) from None
# Not an int?
elif not isinstance(value, int) or isinstance(value, bool):
raise _member_error(type_, value, member_fqn)
# float?
elif builtin == 'float':
# Convert string, int, or Decimal?
if isinstance(value, (str, int, Decimal)) and not isinstance(value, bool):
try:
value_new = float(value)
if isnan(value_new) or isinf(value_new):
raise ValueError()
except ValueError:
raise _member_error(type_, value, member_fqn) from None
# Not a float?
elif not isinstance(value, float):
raise _member_error(type_, value, member_fqn)
# bool?
elif builtin == 'bool':
# Convert string?
if isinstance(value, str):
if value == 'true':
value_new = True
elif value == 'false':
value_new = False
else:
raise _member_error(type_, value, member_fqn)
# Not a bool?
elif not isinstance(value, bool):
raise _member_error(type_, value, member_fqn)
# date?
elif builtin == 'date':
# Convert string?
if isinstance(value, str):
try:
value_new = datetime.fromisoformat(value).date()
except ValueError:
raise _member_error(type_, value, member_fqn)
# Not a date?
elif not isinstance(value, date) or isinstance(value, datetime):
raise _member_error(type_, value, member_fqn)
# datetime?
elif builtin == 'datetime':
# Convert string?
if isinstance(value, str):
try:
value_new = datetime.fromisoformat(value)
except ValueError:
raise _member_error(type_, value, member_fqn)
# No timezone?
if value_new.tzinfo is None:
value_new = value_new.replace(tzinfo=timezone.utc)
# Not a datetime?
elif not isinstance(value, datetime):
raise _member_error(type_, value, member_fqn)
# uuid?
elif builtin == 'uuid':
# Convert string?
if isinstance(value, str):
try:
value_new = UUID(value)
except ValueError:
raise _member_error(type_, value, member_fqn)
# Not a UUID?
elif not isinstance(value, UUID):
raise _member_error(type_, value, member_fqn)
# array?
elif 'array' in type_:
# Valid value type?
array = type_['array']
array_type = array['type']
array_attr = array.get('attr')
if isinstance(value, str) and value == '':
value_new = []
elif not isinstance(value, (list, tuple)):
raise _member_error(type_, value, member_fqn)
# Validate the list contents
value_copy = []
array_value_nullable = array_attr is not None and 'nullable' in array_attr and array_attr['nullable']
for ix_array_value, array_value in enumerate(value_new):
member_fqn_value = f'{ix_array_value}' if member_fqn is None else f'{member_fqn}.{ix_array_value}'
if array_value_nullable and (array_value is None or array_value == 'null'):
array_value = None
else:
array_value = _validate_type(types, array_type, array_value, member_fqn_value)
_validate_attr(array_type, array_attr, array_value, member_fqn_value)
value_copy.append(array_value)
# Return the validated, transformed copy
value_new = value_copy
# dict?
elif 'dict' in type_:
# Valid value type?
dict_ = type_['dict']
dict_type = dict_['type']
dict_attr = dict_.get('attr')
dict_key_type = dict_['keyType'] if 'keyType' in dict_ else {'builtin': 'string'}
dict_key_attr = dict_.get('keyAttr')
if isinstance(value, str) and value == '':
value_new = {}
elif not isinstance(value, dict):
raise _member_error(type_, value, member_fqn)
# Validate the dict key/value pairs
value_copy = {}
dict_key_nullable = dict_key_attr is not None and 'nullable' in dict_key_attr and dict_key_attr['nullable']
dict_value_nullable = dict_attr is not None and 'nullable' in dict_attr and dict_attr['nullable']
for dict_key, dict_value in value_new.items():
member_fqn_key = dict_key if member_fqn is None else f'{member_fqn}.{dict_key}'
# Validate the key
if dict_key_nullable and (dict_key is None or dict_key == 'null'):
dict_key = None
else:
dict_key = _validate_type(types, dict_key_type, dict_key, member_fqn)
_validate_attr(dict_key_type, dict_key_attr, dict_key, member_fqn)
# Validate the value
if dict_value_nullable and (dict_value is None or dict_value == 'null'):
dict_value = None
else:
dict_value = _validate_type(types, dict_type, dict_value, member_fqn_key)
_validate_attr(dict_type, dict_attr, dict_value, member_fqn_key)
# Copy the key/value
value_copy[dict_key] = dict_value
# Return the validated, transformed copy
value_new = value_copy
# User type?
elif 'user' in type_:
user_type = types[type_['user']]
# action?
if 'action' in user_type:
raise _member_error(type_, value, member_fqn)
# typedef?
if 'typedef' in user_type:
typedef = user_type['typedef']
typedef_attr = typedef.get('attr')
# Validate the value
value_nullable = typedef_attr is not None and 'nullable' in typedef_attr and typedef_attr['nullable']
if value_nullable and (value is None or value == 'null'):
value_new = None
else:
value_new = _validate_type(types, typedef['type'], value, member_fqn)
_validate_attr(type_, typedef_attr, value_new, member_fqn)
# enum?
elif 'enum' in user_type:
enum = user_type['enum']
# Not a valid enum value?
if value not in (enum_value['name'] for enum_value in get_enum_values(types, enum)):
raise _member_error(type_, value, member_fqn)
# struct?
elif 'struct' in user_type:
struct = user_type['struct']
# Valid value type?
if isinstance(value, str) and value == '':
value_new = {}
elif not isinstance(value, dict):
raise _member_error({'user': struct['name']}, value, member_fqn)
# Valid union?
is_union = struct.get('union', False)
if is_union:
if len(value) != 1:
raise _member_error({'user': struct['name']}, value, member_fqn)
# Validate the struct members
value_copy = {}
for member in get_struct_members(types, struct):
member_name = member['name']
member_fqn_member = member_name if member_fqn is None else f'{member_fqn}.{member_name}'
member_optional = member.get('optional', False)
member_nullable = 'attr' in member and member['attr'].get('nullable', False)
# Missing non-optional member?
if member_name not in value_new:
if not member_optional and not is_union:
raise ValidationError(f"Required member {member_fqn_member!r} missing")
else:
# Validate the member value
member_value = value_new[member_name]
if member_nullable and (member_value is None or member_value == 'null'):
member_value = None
else:
member_value = _validate_type(types, member['type'], member_value, member_fqn_member)
_validate_attr(member['type'], member.get('attr'), member_value, member_fqn_member)
# Copy the validated member
value_copy[member_name] = member_value
# Any unknown members?
if len(value_copy) != len(value_new):
member_set = {member['name'] for member in get_struct_members(types, struct)}
unknown_key = next(value_name for value_name in value_new.keys() if value_name not in member_set) # pragma: no branch
unknown_fqn = unknown_key if member_fqn is None else f'{member_fqn}.{unknown_key}'
raise ValidationError(f"Unknown member {unknown_fqn!r:.100s}")
# Return the validated, transformed copy
value_new = value_copy
return value_new
def _member_error(type_, value, member_fqn, attr=None):
member_part = f" for member {member_fqn!r}" if member_fqn else ''
type_name = type_['builtin'] if 'builtin' in type_ else (
'array' if 'array' in type_ else ('dict' if 'dict' in type_ else type_['user']))
attr_part = f' [{attr}]' if attr else ''
msg = f"Invalid value {value!r:.1000s} (type {value.__class__.__name__!r}){member_part}, expected type {type_name!r}{attr_part}"
return ValidationError(msg, member_fqn)
def _validate_attr(type_, attr, value, member_fqn):
if attr is not None:
if 'eq' in attr and not value == attr['eq']:
raise _member_error(type_, value, member_fqn, f'== {attr["eq"]}')
if 'lt' in attr and not value < attr['lt']:
raise _member_error(type_, value, member_fqn, f'< {attr["lt"]}')
if 'lte' in attr and not value <= attr['lte']:
raise _member_error(type_, value, member_fqn, f'<= {attr["lte"]}')
if 'gt' in attr and not value > attr['gt']:
raise _member_error(type_, value, member_fqn, f'> {attr["gt"]}')
if 'gte' in attr and not value >= attr['gte']:
raise _member_error(type_, value, member_fqn, f'>= {attr["gte"]}')
if 'lenEq' in attr and not len(value) == attr['lenEq']:
raise _member_error(type_, value, member_fqn, f'len == {attr["lenEq"]}')
if 'lenLT' in attr and not len(value) < attr['lenLT']:
raise _member_error(type_, value, member_fqn, f'len < {attr["lenLT"]}')
if 'lenLTE' in attr and not len(value) <= attr['lenLTE']:
raise _member_error(type_, value, member_fqn, f'len <= {attr["lenLTE"]}')
if 'lenGT' in attr and not len(value) > attr['lenGT']:
raise _member_error(type_, value, member_fqn, f'len > {attr["lenGT"]}')
if 'lenGTE' in attr and not len(value) >= attr['lenGTE']:
raise _member_error(type_, value, member_fqn, f'len >= {attr["lenGTE"]}')
def get_struct_members(types, struct):
"""
Iterate the struct's members (inherited members first)
:param dict types: The `type model <https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types'>`__
:param dict struct: The `struct model <https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Struct'>`__
:returns: An iterator of `struct member models <https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='StructMember'>`__
"""
if 'bases' in struct:
for base in struct['bases']:
base_user_type = types[base]
while 'typedef' in base_user_type:
base_user_type = types[base_user_type['typedef']['type']['user']]
yield from get_struct_members(types, base_user_type['struct'])
if 'members' in struct:
yield from struct['members']
def get_enum_values(types, enum):
"""
Iterate the enum's values (inherited values first)
:param dict types: The `type model <https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types'>`__
:param dict enum: The `enum model <https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Enum'>`__
:returns: An iterator of `enum value models <https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='EnumValue'>`__
"""
if 'bases' in enum:
for base in enum['bases']:
base_user_type = types[base]
while 'typedef' in base_user_type:
base_user_type = types[base_user_type['typedef']['type']['user']]
yield from get_enum_values(types, base_user_type['enum'])
if 'values' in enum:
yield from enum['values']
def validate_type_model(types):
"""
Validate a user type model
:param dict types: The `type model <https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types'>`__
:returns: The validated `type model <https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types'>`__
:raises ValidationError: A validation error occurred
"""
# Validate with the type model
validated_types = validate_type(TYPE_MODEL, 'Types', types)
# Do additional type model validation
errors = validate_type_model_errors(validated_types)
if errors:
raise ValidationError('\n'.join(message for _, _, message in sorted(errors)))
return validated_types
|
/schema_markdown-1.2.6-py3-none-any.whl/schema_markdown/schema.py
| 0.818483 | 0.172102 |
schema.py
|
pypi
|
from datetime import date, datetime, timezone
from decimal import Decimal
import json
from urllib.parse import quote, unquote
from uuid import UUID
class JSONEncoder(json.JSONEncoder):
"""
A :class:`~json.JSONEncoder` sub-class with support for :class:`~datetime.datetime`, :class:`~datetime.date`,
:class:`~decimal.Decimal`, and :class:`~uuid.UUID` objects.
"""
__slots__ = ()
def default(self, o):
"""
The override of the :meth:`~json.JSONEncoder.default` method to add support for :class:`~datetime.datetime`,
:class:`~datetime.date`, :class:`~decimal.Decimal`, and :class:`~uuid.UUID` objects.
"""
if isinstance(o, datetime):
return (o if o.tzinfo else o.replace(tzinfo=timezone.utc)).isoformat()
if isinstance(o, date):
return o.isoformat()
if isinstance(o, Decimal):
return float(o)
if isinstance(o, UUID):
return f'{o}'
return json.JSONEncoder.default(self, o)
def encode_query_string(obj, encoding='utf-8'):
"""
Encode an object as a query string. Dictionaries, lists, and tuples are recursed. Each member key is expressed in
fully-qualified form. List keys are the index into the list, and are in order. For example:
>>> schema_markdown.encode_query_string({'a': 5, 'b': 3.14, 'c': {'d': 'foo', 'e': [1, 2, 3]}, 'f': [{'g': True}, {'g': False}]})
'a=5&b=3.14&c.d=foo&c.e.0=1&c.e.1=2&c.e.2=3&f.0.g=true&f.1.g=false'
:param object obj: The object to encode as a query string
:param str encoding: The query string encoding
:returns: The encoded query string
"""
return '&'.join(f'{v}' if k is None else f'{k}={v}' for k, v in _encode_query_string_items(obj, None, encoding))
def _encode_query_string_items(obj, parent, encoding):
if isinstance(obj, dict):
if obj:
for member, value in sorted(obj.items()):
member_quoted = quote(f'{member}', encoding=encoding)
parent_member = f'{parent}.{member_quoted}' if parent else member_quoted
yield from _encode_query_string_items(value, parent_member, encoding)
elif parent:
yield parent, ''
elif isinstance(obj, (list, tuple)):
if obj:
for idx, value in enumerate(obj):
parent_member = f'{parent}.{idx}' if parent else f'{idx}'
yield from _encode_query_string_items(value, parent_member, encoding)
elif parent:
yield parent, ''
else:
if isinstance(obj, bool):
yield parent, 'true' if obj else 'false' # quote safe
elif isinstance(obj, int):
yield parent, f'{obj}' # quote safe
elif isinstance(obj, datetime):
if not obj.tzinfo:
obj = obj.replace(tzinfo=timezone.utc)
yield parent, quote(obj.isoformat(), encoding=encoding)
elif isinstance(obj, date):
yield parent, obj.isoformat() # quote safe
elif isinstance(obj, UUID):
yield parent, f'{obj}' # quote safe
elif obj is None:
yield parent, 'null'
else: # str, float
yield parent, quote(f'{obj}', encoding=encoding)
def decode_query_string(query_string, encoding='utf-8'):
"""
Decode an object from a query string. Each member key of the query string is expressed in fully-qualified
form. List keys are the index into the list, must be in order. For example:
>>> schema_markdown.decode_query_string('a=5&b=3.14&c.d=foo&c.e.0=1&c.e.1=2&c.e.2=3&f.0.g=true&f.1.g=false')
{'a': '5', 'b': '3.14', 'c': {'d': 'foo', 'e': ['1', '2', '3']}, 'f': [{'g': 'true'}, {'g': 'false'}]}
:param str query_string: The query string
:param str encoding: The query string encoding
:returns: The decoded object
:raises ValueError: Query string is invalid
"""
# Build the object
result = [None]
key_values = query_string.split('&')
for ix_key_value, key_value in enumerate(key_values):
# Split the key/value string
try:
key_str, value_str = key_value.split('=', 1)
value = unquote(value_str, encoding=encoding)
except ValueError:
# Ignore hash IDs
if ix_key_value == len(key_values) - 1:
continue
raise ValueError(f"Invalid key/value pair {key_value!r:.100s}")
# Find/create the object on which to set the value
parent = result
key_parent = 0
for key in (unquote(key, encoding=encoding) for key in key_str.split('.')):
obj = parent[key_parent]
# Array key? First "key" of an array must start with "0".
if isinstance(obj, list) or (obj is None and key == '0'):
# Create this key's container, if necessary
if obj is None:
obj = parent[key_parent] = []
# Parse the key as an integer
try:
key = int(key)
except:
raise ValueError(f"Invalid array index {key!r:.100s} in key {key_str!r:.100s}")
# Append the value placeholder None
if key == len(obj):
obj.append(None)
elif key < 0 or key > len(obj):
raise ValueError(f"Invalid array index {key} in key {key_str!r:.100s}")
# Dictionary key
else:
# Create this key's container, if necessary
if obj is None:
obj = parent[key_parent] = {}
# Create the index for this key
if obj.get(key) is None:
obj[key] = None
# Update the parent object and key
parent = obj
key_parent = key
# Set the value
if parent[key_parent] is not None:
raise ValueError(f"Duplicate key {key_str!r:.100s}")
parent[key_parent] = value
return result[0] if result[0] is not None else {}
|
/schema_markdown-1.2.6-py3-none-any.whl/schema_markdown/encode.py
| 0.854171 | 0.2901 |
encode.py
|
pypi
|
from .parser import parse_schema_markdown
#: The Schema Markdown type model
TYPE_MODEL = parse_schema_markdown('''\
# Map of user type name to user type model
typedef UserType{len > 0} Types
# Union representing a member type
union Type
# A built-in type
BuiltinType builtin
# An array type
Array array
# A dictionary type
Dict dict
# A user type name
string user
# A type or member's attributes
struct Attributes
# If true, the value may be null
optional bool nullable
# The value is equal
optional float eq
# The value is less than
optional float lt
# The value is less than or equal to
optional float lte
# The value is greater than
optional float gt
# The value is greater than or equal to
optional float gte
# The length is equal to
optional int lenEq
# The length is less-than
optional int lenLT
# The length is less than or equal to
optional int lenLTE
# The length is greater than
optional int lenGT
# The length is greater than or equal to
optional int lenGTE
# The built-in type enumeration
enum BuiltinType
# The string type
string
# The integer type
int
# The float type
float
# The boolean type
bool
# A date formatted as an ISO-8601 date string
date
# A date/time formatted as an ISO-8601 date/time string
datetime
# A UUID formatted as string
uuid
# An object of any type
object
# An array type
struct Array
# The contained type
Type type
# The contained type's attributes
optional Attributes attr
# A dictionary type
struct Dict
# The contained key type
Type type
# The contained key type's attributes
optional Attributes attr
# The contained value type
optional Type keyType
# The contained value type's attributes
optional Attributes keyAttr
# A user type
union UserType
# An enumeration type
Enum enum
# A struct type
Struct struct
# A type definition
Typedef typedef
# A JSON web API (not reference-able)
Action action
# User type base struct
struct UserBase
# The user type name
string name
# The documentation markdown text lines
optional string[] doc
# The documentation group name
optional string docGroup
# An enumeration type
struct Enum (UserBase)
# The enum's base enumerations
optional string[len > 0] bases
# The enumeration values
optional EnumValue[len > 0] values
# An enumeration type value
struct EnumValue
# The value string
string name
# The documentation markdown text lines
optional string[] doc
# A struct type
struct Struct (UserBase)
# The struct's base classes
optional string[len > 0] bases
# If true, the struct is a union and exactly one of the optional members is present
optional bool union
# The struct members
optional StructMember[len > 0] members
# A struct member
struct StructMember
# The member name
string name
# The documentation markdown text lines
optional string[] doc
# The member type
Type type
# The member type attributes
optional Attributes attr
# If true, the member is optional and may not be present
optional bool optional
# A typedef type
struct Typedef (UserBase)
# The typedef's type
Type type
# The typedef's type attributes
optional Attributes attr
# A JSON web service API
struct Action (UserBase)
# The action's URLs
optional ActionURL[len > 0] urls
# The path parameters struct type name
optional string path
# The query parameters struct type name
optional string query
# The content body struct type name
optional string input
# The response body struct type name
optional string output
# The custom error response codes enum type name
optional string errors
# An action URL model
struct ActionURL
# The HTTP method. If not provided, matches all HTTP methods.
optional string method
# The URL path. If not provided, uses the default URL path of "/<actionName>".
optional string path
''')
|
/schema_markdown-1.2.6-py3-none-any.whl/schema_markdown/type_model.py
| 0.797675 | 0.289786 |
type_model.py
|
pypi
|
from itertools import chain
import re
from .schema_util import validate_type_model_errors
# Built-in types
BUILTIN_TYPES = {'bool', 'date', 'datetime', 'float', 'int', 'object', 'string', 'uuid'}
# Schema Markdown regex
RE_PART_ID = r'(?:[A-Za-z]\w*)'
RE_PART_ATTR_GROUP = \
r'(?:(?P<nullable>nullable)' \
r'|(?P<op><=|<|>|>=|==)\s*(?P<opnum>-?\d+(?:\.\d+)?)' \
r'|(?P<ltype>len)\s*(?P<lop><=|<|>|>=|==)\s*(?P<lopnum>\d+))'
RE_PART_ATTR = re.sub(r'\(\?P<[^>]+>', r'(?:', RE_PART_ATTR_GROUP)
RE_PART_ATTRS = r'(?:' + RE_PART_ATTR + r'(?:\s*,\s*' + RE_PART_ATTR + r')*)'
RE_ATTR_GROUP = re.compile(RE_PART_ATTR_GROUP)
RE_FIND_ATTRS = re.compile(RE_PART_ATTR + r'(?:\s*,\s*|\s*\Z)')
RE_LINE_CONT = re.compile(r'\\s*$')
RE_COMMENT = re.compile(r'^\s*(?:#-.*|#(?P<doc>.*))?$')
RE_GROUP = re.compile(r'^group(?:\s+"(?P<group>.+?)")?\s*$')
RE_ACTION = re.compile(r'^action\s+(?P<id>' + RE_PART_ID + r')')
RE_PART_BASE_IDS = r'(?:\s*\(\s*(?P<base_ids>' + RE_PART_ID + r'(?:\s*,\s*' + RE_PART_ID + r')*)\s*\)\s*)'
RE_BASE_IDS_SPLIT = re.compile(r'\s*,\s*')
RE_DEFINITION = re.compile(r'^(?P<type>struct|union|enum)\s+(?P<id>' + RE_PART_ID + r')' + RE_PART_BASE_IDS + r'?\s*$')
RE_SECTION = re.compile(r'^\s+(?P<type>path|query|input|output|errors)' + RE_PART_BASE_IDS + r'?\s*$')
RE_SECTION_PLAIN = re.compile(r'^\s+(?P<type>urls)\s*$')
RE_PART_TYPEDEF = \
r'(?P<type>' + RE_PART_ID + r')' \
r'(?:\s*\(\s*(?P<attrs>' + RE_PART_ATTRS + r')\s*\))?' \
r'(?:' \
r'(?:\s*\[\s*(?P<array>' + RE_PART_ATTRS + r'?)\s*\])?' \
r'|' \
r'(?:' \
r'\s*:\s*(?P<dictValueType>' + RE_PART_ID + r')' \
r'(?:\s*\(\s*(?P<dictValueAttrs>' + RE_PART_ATTRS + r')\s*\))?' \
r')?' \
r'(?:\s*\{\s*(?P<dict>' + RE_PART_ATTRS + r'?)\s*\})?' \
r')' \
r'\s+(?P<id>' + RE_PART_ID + r')'
RE_TYPEDEF = re.compile(r'^typedef\s+' + RE_PART_TYPEDEF + r'\s*$')
RE_MEMBER = re.compile(r'^\s+(?P<optional>optional\s+)?' + RE_PART_TYPEDEF + r'\s*$')
RE_VALUE = re.compile(r'^\s+(?P<id>' + RE_PART_ID + r')\s*$')
RE_VALUE_QUOTED = re.compile(r'^\s+"(?P<id>.*?)"\s*$')
RE_URL = re.compile(r'^\s+(?P<method>[A-Za-z]+|\*)(?:\s+(?P<path>/\S*))?')
def parse_schema_markdown(text, types=None, filename='', validate=True):
"""
Parse Schema Markdown from a string or an iterator of strings
:param text: The Schema Markdown text
:type text: str or ~collections.abc.Iterable(str)
:param object types: The `type model <https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types'>`__
:param str filename: The name of file being parsed (for error messages)
:param bool validate: If True, validate after parsing
:returns: The `type model <https://craigahobbs.github.io/schema-markdown-doc/doc/#var.vName='Types'>`__
:raises SchemaMarkdownParserError: A parsing error occurred
"""
# Current parser state
if types is None:
types = {}
error_map = {}
filepos = {}
action = None
urls = None
user_type = None
doc = []
doc_group = None
linenum = 0
# Helper function to add an error message
def add_error(msg, error_filename, error_linenum):
error_msg = f'{error_filename}:{error_linenum}: error: {msg}'
error_map[error_msg] = (error_filename, error_linenum, error_msg)
# Helper function to get documentation strings
def get_doc():
nonlocal doc
result = None
if doc:
result = doc
doc = []
return result
# Line-split all script text
if isinstance(text, str):
lines = text.splitlines()
else:
lines = list(chain.from_iterable(text_part.splitlines() for text_part in text))
lines.append('')
# Process each line
line_continuation = []
for line_part in lines:
linenum += 1
# Line continuation?
line_part_no_continuation = RE_LINE_CONT.sub('', line_part)
if line_continuation or line_part_no_continuation is not line_part:
line_continuation.append(line_part_no_continuation)
if line_part_no_continuation is not line_part:
continue
if line_continuation:
line = ''.join(line_continuation)
del line_continuation[:]
else:
line = line_part
# Match syntax
match_name, match = 'comment', RE_COMMENT.search(line)
if match is None:
match_name, match = 'group', RE_GROUP.search(line)
if match is None:
match_name, match = 'action', RE_ACTION.search(line)
if match is None:
match_name, match = 'definition', RE_DEFINITION.search(line)
if match is None and action is not None:
match_name, match = 'section', RE_SECTION.search(line)
if match is None and action is not None:
match_name, match = 'section_plain', RE_SECTION_PLAIN.search(line)
if match is None and user_type is not None and 'enum' in user_type:
match_value = RE_VALUE.search(line)
if match_value is not None:
match_name, match = 'value', match_value
else:
match_name, match = 'value', RE_VALUE_QUOTED.search(line)
if match is None and user_type is not None and 'struct' in user_type:
match_name, match = 'member', RE_MEMBER.search(line)
if match is None and urls is not None:
match_name, match = 'urls', RE_URL.search(line)
if match is None:
match_name, match = 'typedef', RE_TYPEDEF.search(line)
if match is None:
match_name = None
# Comment?
if match_name == 'comment':
doc_string = match.group('doc')
if doc_string is not None:
doc.append(doc_string if not doc_string.startswith(' ') else doc_string[1:])
# Documentation group?
elif match_name == 'group':
doc_group = match.group('group')
if doc_group is not None:
doc_group = doc_group.strip()
else:
doc_group = None
# Action?
elif match_name == 'action':
action_id = match.group('id')
# Action already defined?
if action_id in types:
add_error(f"Redefinition of action '{action_id}'", filename, linenum)
# Clear parser state
urls = None
user_type = None
action_doc = get_doc()
# Create the new action
action = {'name': action_id}
types[action_id] = {'action': action}
if action_doc is not None:
action['doc'] = action_doc
if doc_group is not None:
action['docGroup'] = doc_group
# Definition?
elif match_name == 'definition':
definition_string = match.group('type')
definition_id = match.group('id')
definition_base_ids = match.group('base_ids')
# Type already defined?
if definition_id in BUILTIN_TYPES or definition_id in types:
add_error(f"Redefinition of type '{definition_id}'", filename, linenum)
# Clear parser state
action = None
urls = None
definition_doc = get_doc()
# Struct definition
if definition_string in ('struct', 'union'):
# Create the new struct type
struct = {'name': definition_id}
user_type = types[definition_id] = {'struct': struct}
if definition_doc is not None:
struct['doc'] = definition_doc
if doc_group is not None:
struct['docGroup'] = doc_group
if definition_string == 'union':
struct['union'] = True
if definition_base_ids is not None:
struct['bases'] = RE_BASE_IDS_SPLIT.split(definition_base_ids)
# Enum definition
else: # definition_string == 'enum':
# Create the new enum type
enum = {'name': definition_id}
user_type = types[definition_id] = {'enum': enum}
if definition_doc is not None:
enum['doc'] = definition_doc
if doc_group is not None:
enum['docGroup'] = doc_group
if definition_base_ids is not None:
enum['bases'] = RE_BASE_IDS_SPLIT.split(definition_base_ids)
# Record finalization information
filepos[definition_id] = linenum
# Action section?
elif match_name == 'section':
section_string = match.group('type')
section_base_ids = match.group('base_ids')
# Action section redefinition?
if section_string in action:
add_error(f'Redefinition of action {section_string}', filename, linenum)
# Clear parser state
urls = None
# Set the action section type
section_type_name = f'{action["name"]}_{section_string}'
action[section_string] = section_type_name
if section_string == 'errors':
enum = {'name': section_type_name}
user_type = types[section_type_name] = {'enum': enum}
if section_base_ids is not None:
enum['bases'] = RE_BASE_IDS_SPLIT.split(section_base_ids)
else:
struct = {'name': section_type_name}
user_type = types[section_type_name] = {'struct': struct}
if section_base_ids is not None:
struct['bases'] = RE_BASE_IDS_SPLIT.split(section_base_ids)
# Record finalization information
filepos[section_type_name] = linenum
# Plain action section?
elif match_name == 'section_plain':
section_string = match.group('type')
# Action section redefinition?
if section_string in action:
add_error(f'Redefinition of action {section_string}', filename, linenum)
# Clear parser state
user_type = None
# Update the parser state
urls = []
# Enum value?
elif match_name == 'value':
value_string = match.group('id')
# Add the enum value
enum = user_type['enum']
if 'values' not in enum:
enum['values'] = []
enum_value = {'name': value_string}
enum['values'].append(enum_value)
enum_value_doc = get_doc()
if enum_value_doc is not None:
enum_value['doc'] = enum_value_doc
# Record finalization information
filepos[f'{enum["name"]}.{value_string}'] = linenum
# Struct member?
elif match_name == 'member':
optional = match.group('optional') is not None
member_name = match.group('id')
# Add the member
struct = user_type['struct']
if 'members' not in struct:
struct['members'] = []
member_type, member_attr = _parse_typedef(match)
member_doc = get_doc()
member = {
'name': member_name,
'type': member_type
}
struct['members'].append(member)
if member_attr is not None:
member['attr'] = member_attr
if member_doc is not None:
member['doc'] = member_doc
if optional:
member['optional'] = True
# Record finalization information
filepos[f'{struct["name"]}.{member_name}'] = linenum
# URL?
elif match_name == 'urls':
method = match.group('method')
path = match.group('path')
# Create the action URL object
action_url = {}
if method != '*':
action_url['method'] = method
if path is not None:
action_url['path'] = path
# Duplicate URL?
if action_url in urls:
padded_path = "" if path is None else f' {path}'
add_error(f'Duplicate URL: {method}{padded_path}', filename, linenum)
# Add the URL
if 'urls' not in action:
action['urls'] = urls
urls.append(action_url)
# Typedef?
elif match_name == 'typedef':
definition_id = match.group('id')
# Type already defined?
if definition_id in BUILTIN_TYPES or definition_id in types:
add_error(f"Redefinition of type '{definition_id}'", filename, linenum)
# Clear parser state
action = None
urls = None
user_type = None
typedef_doc = get_doc()
# Create the typedef
typedef_type, typedef_attr = _parse_typedef(match)
typedef = {
'name': definition_id,
'type': typedef_type
}
types[definition_id] = {'typedef': typedef}
if typedef_attr is not None:
typedef['attr'] = typedef_attr
if typedef_doc is not None:
typedef['doc'] = typedef_doc
if doc_group is not None:
typedef['docGroup'] = doc_group
# Record finalization information
filepos[definition_id] = linenum
# Unrecognized line syntax
else:
add_error('Syntax error', filename, linenum)
# Validate the type model, if requested
if validate:
for type_name, member_name, error_msg in validate_type_model_errors(types):
error_filename = filename
error_linenum = None
if member_name is not None:
error_linenum = filepos.get(f'{type_name}.{member_name}')
if error_linenum is None:
error_linenum = filepos.get(type_name)
if error_linenum is None:
error_filename = ''
error_linenum = 1
add_error(error_msg, error_filename, error_linenum)
# Raise a parser exception if there are any errors
errors = [msg for _, _, msg in sorted(error_map.values())]
if errors:
raise SchemaMarkdownParserError(errors)
return types
# Helper function to parse a typedef - returns a type-model and attributes-model tuple
def _parse_typedef(match_typedef):
array_attrs_string = match_typedef.group('array')
dict_attrs_string = match_typedef.group('dict')
# Array type?
if array_attrs_string is not None:
value_type_name = match_typedef.group('type')
value_attr = _parse_attr(match_typedef.group('attrs'))
array_type = {'type': _create_type(value_type_name)}
if value_attr is not None:
array_type['attr'] = value_attr
return {'array': array_type}, _parse_attr(array_attrs_string)
# Dictionary type?
if dict_attrs_string is not None:
value_type_name = match_typedef.group('dictValueType')
if value_type_name is not None:
value_attr = _parse_attr(match_typedef.group('dictValueAttrs'))
key_type_name = match_typedef.group('type')
key_attr = _parse_attr(match_typedef.group('attrs'))
dict_type = {
'type': _create_type(value_type_name),
'keyType': _create_type(key_type_name)
}
if value_attr is not None:
dict_type['attr'] = value_attr
if key_attr is not None:
dict_type['keyAttr'] = key_attr
else:
value_type_name = match_typedef.group('type')
value_attr = _parse_attr(match_typedef.group('attrs'))
dict_type = {'type': _create_type(value_type_name)}
if value_attr is not None:
dict_type['attr'] = value_attr
return {'dict': dict_type}, _parse_attr(dict_attrs_string)
# Non-container type...
member_type_name = match_typedef.group('type')
return _create_type(member_type_name), _parse_attr(match_typedef.group('attrs'))
# Helper function to create a type model
def _create_type(type_name):
if type_name in BUILTIN_TYPES:
return {'builtin': type_name}
return {'user': type_name}
# Helper function to parse an attributes string - returns an attributes model
def _parse_attr(attrs_string):
attrs = None
if attrs_string is not None:
for attr_string in RE_FIND_ATTRS.findall(attrs_string):
if attrs is None:
attrs = {}
match_attr = RE_ATTR_GROUP.match(attr_string)
attr_op = match_attr.group('op')
attr_length_op = match_attr.group('lop') if attr_op is None else None
if match_attr.group('nullable') is not None:
attrs['nullable'] = True
elif attr_op is not None:
attr_value = float(match_attr.group('opnum'))
if attr_op == '<':
attrs['lt'] = attr_value
elif attr_op == '<=':
attrs['lte'] = attr_value
elif attr_op == '>':
attrs['gt'] = attr_value
elif attr_op == '>=':
attrs['gte'] = attr_value
else: # ==
attrs['eq'] = attr_value
else: # attr_length_op is not None:
attr_value = int(match_attr.group('lopnum'))
if attr_length_op == '<':
attrs['lenLT'] = attr_value
elif attr_length_op == '<=':
attrs['lenLTE'] = attr_value
elif attr_length_op == '>':
attrs['lenGT'] = attr_value
elif attr_length_op == '>=':
attrs['lenGTE'] = attr_value
else: # ==
attrs['lenEq'] = attr_value
return attrs
class SchemaMarkdownParserError(Exception):
"""
Schema Markdown parser exception
:param list(str) errors: The list of error strings
"""
__slots__ = ('errors',)
def __init__(self, errors):
super().__init__('\n'.join(errors))
#: The list of error strings
self.errors = errors
|
/schema_markdown-1.2.6-py3-none-any.whl/schema_markdown/parser.py
| 0.425844 | 0.186447 |
parser.py
|
pypi
|
[](https://pypi.org/project/schema-matching/)
# Python Schema Matching by XGboost and Sentence-Transformers
A python tool using XGboost and sentence-transformers to perform schema matching task on tables. Support multi-language column names and instances matching and can be used without column names. Both csv and json file type are supported.
## What is schema matching?

Schema matching is the problem of finding potential associations between elements (most often attributes or relations) of two schemas.
[source](https://link.springer.com/referenceworkentry/10.1007/978-3-319-77525-8_20)
## Dependencies
- numpy==1.19.5
- pandas==1.1.5
- nltk==3.6.5
- python-dateutil==2.8.2
- sentence-transformers==2.1.0
- xgboost==1.5.2
- strsimpy==0.2.1
## Package usage
### Install
```
pip install schema-matching
```
### Conduct schema matching
```
from schema_matching import schema_matching
df_pred,df_pred_labels,predicted_pairs = schema_matching("Test Data/QA/Table1.json","Test Data/QA/Table2.json")
print(df_pred)
print(df_pred_labels)
for pair_tuple in predicted_pairs:
print(pair_tuple)
```
#### Return:
- df_pred: Predict value matrix, pd.DataFrame.
- df_pred_labels: Predict label matrix, pd.DataFrame.
- predicted_pairs: Predict label == 1 column pairs, in tuple format.
#### Parameters:
- table1_pth: Path to your first **csv, json or jsonl file**.
- table2_pth: Path to your second **csv, json or jsonl file**.
- threshold: Threshold, you can use this parameter to specify threshold value, suggest 0.9 for easy matching(column name very similar). Default value is calculated from training data, which is around 0.15-0.2. This value is used for difficult matching(column name masked or very different).
- strategy: Strategy, there are three options: "one-to-one", "one-to-many" and "many-to-many". "one-to-one" means that one column can only be matched to one column. "one-to-many" means that columns in Table1 can only be matched to one column in Table2. "many-to-many" means that there is no restrictions. Default is "many-to-many".
- model_pth: Path to trained model folder, which must contain at least one pair of ".model" file and ".threshold" file. You don't need to specify this parameter.
## Raw code usage: Training
### Data
See Data format in Training Data and Test Data folders. You need to put mapping.txt, Table1.csv and Table2.csv in new folders under Training Data. For Test Data, mapping.txt is not needed.
### 1.Construct features
```
python relation_features.py
```
### 2.Train xgboost models
```
python train.py
```
### 3.Calculate similarity matrix (inference)
```
Example:
python cal_column_similarity.py -p Test\ Data/self -m /model/2022-04-12-12-06-32 -s one-to-one
python cal_column_similarity.py -p Test\ Data/authors -m /model/2022-04-12-12-06-32-11 -t 0.9
```
Parameters:
- -p: Path to test data folder, must contain **"Table1.csv" and "Table2.csv" or "Table1.json" and "Table2.json"**.
- -m: Path to trained model folder, which must contain at least one pair of ".model" file and ".threshold" file.
- -t: Threshold, you can use this parameter to specify threshold value, suggest 0.9 for easy matching(column name very similar). Default value is calculated from training data, which is around 0.15-0.2. This value is used for difficult matching(column name masked or very different).
- -s: Strategy, there are three options: "one-to-one", "one-to-many" and "many-to-many". "one-to-one" means that one column can only be matched to one column. "one-to-many" means that columns in Table1 can only be matched to one column in Table2. "many-to-many" means that there is no restrictions. Default is "many-to-many".
Output:
- similarity_matrix_label.csv: Labels(0,1) for each column pairs.
- similarity_matrix_value.csv: Average of raw values computed by all the xgboost models.
## Feature Engineering
Features: "is_url","is_numeric","is_date","is_string","numeric:mean", "numeric:min", "numeric:max", "numeric:variance","numeric:cv", "numeric:unique/len(data_list)", "length:mean", "length:min", "length:max", "length:variance","length:cv", "length:unique/len(data_list)", "whitespace_ratios:mean","punctuation_ratios:mean","special_character_ratios:mean","numeric_ratios:mean", "whitespace_ratios:cv","punctuation_ratios:cv","special_character_ratios:cv","numeric_ratios:cv", "colname:bleu_score", "colname:edit_distance","colname:lcs","colname:tsm_cosine", "colname:one_in_one", "instance_similarity:cosine"
- tsm_cosine: Cosine similarity of column names computed by sentence-transformers using "paraphrase-multilingual-mpnet-base-v2". Support multi-language column names matching.
- instance_similarity:cosine: Select 20 instances each string column and compute its mean embedding using sentence-transformers. Cosine similarity is computed by each pairs.
## Performance
### Cross Validation on Training Data(Each pair to be used as test data)
- Average Precision: 0.755
- Average Recall: 0.829
- Average F1: 0.766
Average Confusion Matrix:
| | Negative(Truth) | Positive(Truth) |
|----------------|-----------------|-----------------|
| Negative(pred) | 0.94343111 | 0.05656889 |
| Positive(pred) | 0.17135417 | 0.82864583 |
### Inference on Test Data (Give confusing column names)
Data: https://github.com/fireindark707/Schema_Matching_XGboost/tree/main/Test%20Data/self
| | title | text | summary | keywords | url | country | language | domain | name | timestamp |
|---------|------------|------------|------------|------------|------------|------------|------------|------------|-------|------------|
| col1 | 1(FN) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| col2 | 0 | 1(TP) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| col3 | 0 | 0 | 1(TP) | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| words | 0 | 0 | 0 | 1(TP) | 0 | 0 | 0 | 0 | 0 | 0 |
| link | 0 | 0 | 0 | 0 | 1(TP) | 0 | 0 | 0 | 0 | 0 |
| col6 | 0 | 0 | 0 | 0 | 0 | 1(TP) | 0 | 0 | 0 | 0 |
| lang | 0 | 0 | 0 | 0 | 0 | 0 | 1(TP) | 0 | 0 | 0 |
| col8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1(TP) | 0 | 0 |
| website | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0(FN) | 0 |
| col10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1(TP) |
**F1 score: 0.889**
## Cite
```
@software{fireinfark707_Schema_Matching_by_2022,
author = {fireinfark707},
license = {MIT},
month = {4},
title = {{Schema Matching by XGboost}},
url = {https://github.com/fireindark707/Schema_Matching_XGboost},
year = {2022}
}
```
|
/schema_matching-1.0.4.tar.gz/schema_matching-1.0.4/README.md
| 0.495606 | 0.953751 |
README.md
|
pypi
|
import pandas as pd
import numpy as np
import os
import xgboost as xgb
import datetime
from sklearn.metrics import confusion_matrix
from sklearn.metrics import f1_score, precision_score, recall_score
import warnings
warnings.filterwarnings("ignore")
feature_names = ["is_url","is_numeric","is_date","is_string","numeric:mean", "numeric:min", "numeric:max", "numeric:variance","numeric:cv", "numeric:unique/len(data_list)",
"length:mean", "length:min", "length:max", "length:variance","length:cv", "length:unique/len(data_list)",
"whitespace_ratios:mean","punctuation_ratios:mean","special_character_ratios:mean","numeric_ratios:mean",
"whitespace_ratios:cv","punctuation_ratios:cv","special_character_ratios:cv","numeric_ratios:cv",
"colname:bleu_score", "colname:edit_distance","colname:lcs","colname:tsm_cosine", "colname:one_in_one","instance_similarity:cosine",
]
params = {
'max_depth': 4,
'eta': 0.1,
'objective': 'binary:logistic',
'eval_metric': 'logloss',
}
def train(train_features,train_labels,num_round):
dtrain = xgb.DMatrix(train_features, label=train_labels)
bst = xgb.train(params, dtrain, num_round)
# get best_threshold
best_f1 = 0
best_threshold = 0
for threshold in range(100):
threshold = threshold / 100
pred_labels = np.where(bst.predict(dtrain) > threshold, 1, 0)
f1 = f1_score(train_labels, pred_labels,average="binary",pos_label=1)
if f1 > best_f1:
best_f1 = f1
best_threshold = threshold
return bst,best_threshold
def test(bst,best_threshold, test_features, test_labels, type="evaluation"):
dtest = xgb.DMatrix(test_features, label=test_labels)
pred = bst.predict(dtest)
if type == "inference":
pred_labels = np.where(pred > best_threshold, 1, 0)
return pred,pred_labels
# compute precision, recall, and F1 score
pred_labels = np.where(pred > best_threshold, 1, 0)
precision = precision_score(test_labels, pred_labels,average="binary",pos_label=1)
recall = recall_score(test_labels, pred_labels,average="binary",pos_label=1)
f1 = f1_score(test_labels, pred_labels,average="binary",pos_label=1)
c_matrix = confusion_matrix(test_labels, pred_labels)
return precision, recall, f1, c_matrix
def merge_features(path):
files = os.listdir(path)
files.sort()
merged_features = []
for file in files:
if not "features" in file:
continue
features = np.load(path + file)
merged_features.append(features)
return np.concatenate(merged_features)
def get_labels(path):
files = os.listdir(path)
files.sort()
labels = []
for file in files:
if not "labels" in file:
continue
labels.append(np.load(path + file))
return np.concatenate(labels)
def preprocess(path):
train_path = path + "/train/"
test_path = path + "/test/"
train_features = merge_features(train_path)
train_labels = get_labels(train_path)
test_features = merge_features(test_path)
test_labels = get_labels(test_path)
return train_features, train_labels, test_features, test_labels
def get_feature_importances(bst):
importance = bst.get_fscore()
importance = [(im,feature_names[int(im[0].replace("f",""))]) for im in importance.items()]
importance = sorted(importance, key=lambda x: x[0][1], reverse=True)
return importance
def train_loop(num_round=300):
precision_list = []
recall_list = []
f1_list = []
c_matrix_list = []
feature_importance_list = []
for i in range(len(os.listdir("Input"))):
train_features, train_labels, test_features, test_labels = preprocess("Input/" + str(i))
bst, best_threshold = train(train_features, train_labels, num_round)
precision, recall, f1, c_matrix = test(bst,best_threshold, test_features, test_labels)
feature_importance = get_feature_importances(bst)
c_matrix_norm = c_matrix.astype('float') / c_matrix.sum(axis=1)[:, np.newaxis]
precision_list.append(precision)
recall_list.append(recall)
f1_list.append(f1)
c_matrix_list.append(c_matrix_norm)
feature_importance_list.append(feature_importance)
bst.save_model(model_save_pth+f"/{i}.model")
with open(model_save_pth+f"/{i}.threshold",'w') as f:
f.write(str(best_threshold))
# evaluate feature importance
feature_name_importance = {}
for feature_importance in feature_importance_list:
for (im,feature_name) in feature_importance:
if feature_name in feature_name_importance:
feature_name_importance[feature_name] += im[1]
else:
feature_name_importance[feature_name] = im[1]
feature_name_importance = sorted(feature_name_importance.items(), key=lambda x: x[1], reverse=True)
return precision_list, recall_list, f1_list, c_matrix_list, feature_name_importance
def optimize_hyperparameter(eta_candid,max_depth_candid,num_round_candid):
best_f1 = 0
for eta in eta_candid:
for max_depth in max_depth_candid:
for num_round in num_round_candid:
print(eta, max_depth, num_round)
params["eta"] = eta
params["max_depth"] = max_depth
precision_list, recall_list, f1_list, c_matrix_list, feature_name_importance = train_loop(num_round)
print("Average Precision: %.3f" % np.mean(precision_list))
print("Average Recall: %.3f" % np.mean(recall_list))
print("Average F1: %.3f" % np.mean(f1_list))
if np.mean(f1_list) > best_f1:
best_f1 = np.mean(f1_list)
best_params = params
best_precision = np.mean(precision_list)
best_recall = np.mean(recall_list)
best_params["num_round"] = num_round
return best_params, best_precision, best_recall, best_f1
if __name__ == '__main__':
model_save_pth = "model/"+datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S")
if not os.path.exists(model_save_pth):
os.makedirs(model_save_pth)
precision_list, recall_list, f1_list, c_matrix_list, feature_name_importance = train_loop()
# give evaluation results
print("Average Precision: %.3f" % np.mean(precision_list))
print("Average Recall: %.3f" % np.mean(recall_list))
print("Average F1: %.3f" % np.mean(f1_list))
print(f1_list)
print("Average Confusion Matrix: \n", np.mean(c_matrix_list,axis=0))
print("Feature Importance:")
for importance in feature_name_importance:
print(f"{importance[0]}: {importance[1]}")
# tune parameters
if False:
eta_candidate = [0.08,0.05,0.03, 0.01]
max_depth_candidate = [3,4,5,6,7,8,9,10,12,15,20]
num_round_candidate = [100,200,300,400,500,600,700,800,900,1000]
best_params,best_precision, best_recall, best_f1 = optimize_hyperparameter(eta_candidate,max_depth_candidate,num_round_candidate)
print(best_params)
print(best_precision)
print(best_recall)
print(best_f1)
|
/schema_matching-1.0.4.tar.gz/schema_matching-1.0.4/src/schema_matching/train.py
| 0.467575 | 0.263925 |
train.py
|
pypi
|
from . import init
from .self_features import make_self_features_from
from .utils import table_column_filter
import pandas as pd
import numpy as np
from numpy.linalg import norm
import random
import os
import subprocess
from strsimpy.metric_lcs import MetricLCS
from strsimpy.damerau import Damerau
from nltk.translate import bleu
from nltk.translate.bleu_score import SmoothingFunction
from sentence_transformers import util
import re
model = init.model
smoothie = SmoothingFunction().method4
metriclcs = MetricLCS()
damerau = Damerau()
seed = 200
random.seed(seed)
def preprocess_text(text):
text = text.lower()
text = re.split(r'[\s\_\.]', text)
text = " ".join(text).strip()
return text
def transformer_similarity(text1, text2):
"""
Use sentence transformer to calculate similarity between two sentences.
"""
embeddings1 = model.encode(text1)
embeddings2 = model.encode(text2)
cosine_similarity = util.cos_sim(embeddings1, embeddings2)
return cosine_similarity
def read_mapping(mapping_file):
"""
Read mapping file and return a set.
"""
if mapping_file is None or not os.path.exists(mapping_file):
return set()
with open(mapping_file, 'r') as f:
readed = f.readlines()
readed = [x.strip() for x in readed]
mapping = set()
for map in readed:
map = map.split(",")
map = [m.strip("< >") for m in map]
mapping.add(tuple(map))
return mapping
def make_combinations_labels(columns1, columns2, mapping ,type="train"):
"""
Make combinations from columns1 list and columns2 list. Label them using mapping.
"""
labels = {}
for i,c1 in enumerate(columns1):
for j,c2 in enumerate(columns2):
if (c1, c2) in mapping or (c2, c1) in mapping:
labels[(i, j)] = 1
else:
labels[(i, j)] = 0
# sample negative labels
if type == "train":
combinations_count = len(labels)
for i in range(combinations_count*2):
if sum(labels.values()) >= 0.1 * len(labels):
break
c1 = random.choice(range(len(columns1)))
c2 = random.choice(range(len(columns2)))
if (c1, c2) in labels and labels[c1, c2] == 0:
del labels[(c1, c2)]
return labels
def get_colnames_features(text1,text2,column_name_embeddings):
"""
Use BLEU, edit distance and word2vec to calculate features.
"""
bleu_score = bleu([text1], text2, smoothing_function=smoothie)
edit_distance = damerau.distance(text1, text2)
lcs = metriclcs.distance(text1, text2)
transformer_score = util.cos_sim(column_name_embeddings[text1], column_name_embeddings[text2])
one_in_one = text1 in text2 or text2 in text1
colnames_features = np.array([bleu_score, edit_distance, lcs,transformer_score, one_in_one])
return colnames_features
def get_instance_similarity(embeddings1, embeddings2):
"""
Use cosine similarity between two sentences.
"""
cosine_similarity = np.inner(embeddings1, embeddings2) / (norm(embeddings1) * norm(embeddings2))
return np.array([cosine_similarity])
def make_data_from(table1_df, table2_df,mapping_file=None,type="train"):
"""
Read data from 2 table dataframe, mapping file path and make relational features and labels as a matrix.
"""
mapping = read_mapping(mapping_file)
columns1 = list(table1_df.columns)
columns2 = list(table2_df.columns)
combinations_labels = make_combinations_labels(columns1, columns2, mapping,type)
table1_features = make_self_features_from(table1_df)
table2_features = make_self_features_from(table2_df)
column_name_embeddings = {preprocess_text(k):model.encode(preprocess_text(k)) for k in columns1+columns2}
additional_feature_num = 6
output_feature_table = np.zeros((len(combinations_labels), table1_features.shape[1] - 768+ additional_feature_num), dtype=np.float32)
output_labels = np.zeros(len(combinations_labels), dtype=np.int32)
for i, (combination,label) in enumerate(combinations_labels.items()):
c1,c2 = combination
c1_name = columns1[c1]
c2_name = columns2[c2]
difference_features_percent = np.abs(table1_features[c1] - table2_features[c2]) / (table1_features[c1] + table2_features[c2] + 1e-8)
c1_name = preprocess_text(c1_name)
c2_name = preprocess_text(c2_name)
colnames_features = get_colnames_features(c1_name, c2_name,column_name_embeddings)
instance_similarity = get_instance_similarity(table1_features[c1][-768:], table2_features[c2][-768:])
output_feature_table[i,:] = np.concatenate((difference_features_percent[:-768], colnames_features, instance_similarity))
output_labels[i] = label
# add column names mask for training data
if type == "train" and i % 5 == 0:
colnames_features = np.array([0,12,0,0.2,0])
added_features = np.concatenate((difference_features_percent[:-768], colnames_features, instance_similarity))
added_features = added_features.reshape((1, added_features.shape[0]))
output_feature_table = np.concatenate((output_feature_table, added_features), axis=0)
output_labels = np.concatenate((output_labels, np.array([label])))
return output_feature_table, output_labels
if __name__ == '__main__':
if os.path.exists("Input"):
#remove existing Input folder
subprocess.call(["rm", "-r", "Input"])
# make folders
os.mkdir("Input")
folder_list = os.listdir("Training Data")
train_features = {}
train_labels = {}
test_features = {}
test_labels = {}
for folder in folder_list:
print("start extracting data from " + folder)
data_folder = "Training Data/" + folder
table1_df = pd.read_csv(data_folder + "/Table1.csv")
table2_df = pd.read_csv(data_folder + "/Table2.csv")
table1_df = table_column_filter(table1_df)
table2_df = table_column_filter(table2_df)
mapping_file = data_folder + "/mapping.txt"
features,labels = make_data_from(table1_df, table2_df, mapping_file,type="train")
train_features[folder] = features
train_labels[folder] = labels
features,labels = make_data_from(table1_df, table2_df, mapping_file,type="test")
test_features[folder] = features
test_labels[folder] = labels
# save data using cross validation
for i in range(len(folder_list)):
os.mkdir("Input/" + str(i))
os.mkdir("Input/" + str(i) + "/train")
os.mkdir("Input/" + str(i) + "/test")
test_folder = folder_list[i]
train_folders = folder_list[:i] + folder_list[i+1:]
for folder in train_folders:
np.save("Input/"+ str(i) +"/train/" +folder.split('/')[-1]+ "_features.npy", train_features[folder])
np.save("Input/"+ str(i) +"/train/" +folder.split('/')[-1]+ "_labels.npy", train_labels[folder])
np.save("Input/"+ str(i) +"/test/" +test_folder.split('/')[-1]+ "_features.npy", test_features[test_folder])
np.save("Input/"+ str(i) +"/test/" +test_folder.split('/')[-1]+ "_labels.npy", test_labels[test_folder])
|
/schema_matching-1.0.4.tar.gz/schema_matching-1.0.4/src/schema_matching/relation_features.py
| 0.482917 | 0.284511 |
relation_features.py
|
pypi
|
from six.moves.urllib import parse as urlparse
from schema_res import loader
class SchemaDescriptor(object):
"""
A class implementing the descriptor protocol to automatically load
schemas from package resources. Values are always
``jsonschema.IValidator`` instances, regardless of how the
descriptor is accessed.
"""
def __init__(self, uri_or_fname):
"""
Initialize a ``SchemaDescriptor`` instance.
:param str uri_or_fname: The URI or filename of the schema to
load. Only "res:"-style URIs are
recognized; this cannot be used to
load a schema over the network, in
order to discourage that non-portable
practice. If a bare filename is
provided, it will be interpreted
relative to the ``__module__``
attribute of the owning class.
"""
# Save the URI
self.uri = urlparse.urlparse(uri_or_fname)
# Cache of the loaded schema
self.schema = None
def __get__(self, inst, owner):
"""
Retrieve the specified schema object.
:param inst: An instance of the class. Ignored by this
implementation of the descriptor protocol.
:param owner: The class containing the descriptor.
:returns: The desired schema, loading it as necessary.
:rtype: ``jsonschema.IValidator``
"""
# Do we need to load the schema?
if self.schema is None:
# Is it a fully qualified URL?
if self.uri.scheme:
uri = urlparse.urlunparse(self.uri)
else:
uri = urlparse.urlunparse((
'res', owner.__module__,
self.uri.path, self.uri.params, self.uri.query,
self.uri.fragment,
))
# Load the schema
self.schema = loader.load_schema(uri)
return self.schema
|
/schema-resource-0.0.1.tar.gz/schema-resource-0.0.1/schema_res/descriptor.py
| 0.868032 | 0.277825 |
descriptor.py
|
pypi
|
import jsonschema
import pkg_resources
from six.moves.urllib import parse as urlparse
import yaml
def _res_handler(uri):
"""
Handler for "res:" URIs. A "res:" URI resolves a resource using
``pkg_resources.resource_stream``; the "netloc" part of the URI
(the part after the "res://") should be the package or
requirement, and the "path" part of the URI will be interpreted
relative to the top level of that package or requirement.
:param str uri: The resource URI.
:returns: The result of loading the URI as a YAML file (of which
JSON is a subset).
:rtype: ``dict`` or ``bool``
"""
# Split the URI and extract the parts we're interested in
urisplit = urlparse.urlparse(uri)
if (urisplit.scheme != 'res' or not urisplit.netloc or
urisplit.path in {'', '/'}):
raise ValueError('invalid URI "%s"' % uri)
pkg = urisplit.netloc
path = urisplit.path[1:]
# Return the result of loading the URI
with pkg_resources.resource_stream(pkg, path) as f:
return yaml.safe_load(f)
def load_schema(uri, validate=False):
"""
Loads a schema from a specified resource URI. A resource URI has
the scheme "res:"; the "netloc" part of the URI (the part after
the "res://") should be the package or requirement, and the "path"
part of the URI will be interpreted relative to the top level of
that package or requirement. The schema is loaded as a YAML file
(of which JSON is a subset), and an appropriate ``jsonschema``
validator is returned.
:param str uri: The resource URI.
:param bool validate: If ``True``, the schema will be validated.
Defaults to ``False``.
:returns: A suitable schema validator.
:rtype: ``jsonschema.IValidator``
"""
# Begin by loading the root schema
sch = _res_handler(uri)
# Construct a RefResolver
resolver = jsonschema.RefResolver(
uri, sch,
handlers={'res': _res_handler},
)
# Pick the correct validator matching the schema
val = jsonschema.validators.validator_for(sch)
# Perform the schema validation
if validate:
val.check_schema(sch)
# Return the constructed schema
return val(sch, resolver=resolver)
|
/schema-resource-0.0.1.tar.gz/schema-resource-0.0.1/schema_res/loader.py
| 0.77949 | 0.278836 |
loader.py
|
pypi
|
import logging
import unicodedata
from typing import (
Any,
Dict,
Iterable,
List,
MutableMapping,
MutableSequence,
Optional,
Tuple,
Union,
cast,
)
from urllib.parse import urldefrag, urlsplit
import rdflib
import rdflib.namespace
from rdflib import Graph, URIRef
from rdflib.namespace import RDF, RDFS
from ruamel.yaml.comments import CommentedMap, CommentedSeq
from .exceptions import SchemaException
from .utils import ContextType, aslist, json_dumps
_logger = logging.getLogger("salad")
def pred(
datatype: MutableMapping[str, Union[Dict[str, str], str]],
field: Optional[Dict[str, Any]],
name: str,
context: ContextType,
defaultBase: str,
namespaces: Dict[str, rdflib.namespace.Namespace],
) -> Union[Dict[str, Union[str, None]], str]:
split = urlsplit(name)
vee = None # type: Optional[str]
if split.scheme != "":
vee = name
(ns, ln) = rdflib.namespace.split_uri(str(vee))
name = ln
if ns[0:-1] in namespaces:
vee = str(namespaces[ns[0:-1]][ln])
_logger.debug("name, v %s %s", name, vee)
v = None # type: Optional[Union[Dict[str, Union[str, None]], str]]
if field is not None and "jsonldPredicate" in field:
if isinstance(field["jsonldPredicate"], MutableMapping):
v = {}
for k, val in field["jsonldPredicate"].items():
v[("@" + k[1:] if k.startswith("_") else k)] = val
if "@id" not in v:
v["@id"] = vee
else:
v = field["jsonldPredicate"]
elif "jsonldPredicate" in datatype:
if isinstance(datatype["jsonldPredicate"], Iterable):
for d in datatype["jsonldPredicate"]:
if isinstance(d, MutableMapping):
if d["symbol"] == name:
v = d["predicate"]
else:
raise SchemaException(
"entries in the jsonldPredicate List must be " "Dictionaries"
)
else:
raise SchemaException("jsonldPredicate must be a List of Dictionaries.")
ret = v or vee
if not ret:
ret = defaultBase + name
if name in context:
if context[name] != ret:
raise SchemaException(f"Predicate collision on {name}, {context[name]!r} != {ret!r}")
else:
_logger.debug("Adding to context '%s' %s (%s)", name, ret, type(ret))
context[name] = ret
return ret
def process_type(
t: MutableMapping[str, Any],
g: Graph,
context: ContextType,
defaultBase: str,
namespaces: Dict[str, rdflib.namespace.Namespace],
defaultPrefix: str,
) -> None:
if t["type"] not in ("record", "enum"):
return
if "name" in t:
recordname = t["name"]
_logger.debug("Processing %s %s\n", t.get("type"), t)
classnode = URIRef(recordname)
g.add((classnode, RDF.type, RDFS.Class))
split = urlsplit(recordname)
predicate = recordname
if t.get("inVocab", True):
if split.scheme:
(ns, ln) = rdflib.namespace.split_uri(str(recordname))
predicate = recordname
recordname = ln
else:
predicate = f"{defaultPrefix}:{recordname}"
if context.get(recordname, predicate) != predicate:
raise SchemaException(
f"Predicate collision on {recordname!r}, "
f"{context[recordname]!r} != {predicate!r}"
)
if not recordname:
raise SchemaException(f"Unable to find/derive recordname for {t}")
_logger.debug("Adding to context '%s' %s (%s)", recordname, predicate, type(predicate))
context[recordname] = predicate
if t["type"] == "record":
for i in t.get("fields", []):
fieldname = i["name"]
_logger.debug("Processing field %s", i)
v = pred(
t, i, fieldname, context, defaultPrefix, namespaces
) # type: Union[Dict[Any, Any], str, None]
if isinstance(v, str):
v = v if v[0] != "@" else None
elif v is not None:
v = v["_@id"] if v.get("_@id", "@")[0] != "@" else None
if bool(v):
try:
(ns, ln) = rdflib.namespace.split_uri(str(v))
except ValueError:
# rdflib 5.0.0 compatibility
uri = str(v)
colon_index = str(v).rfind(":")
if colon_index < 0:
raise
split_start = rdflib.namespace.SPLIT_START_CATEGORIES
for j in range(-1 - colon_index, len(uri)):
if unicodedata.category(uri[j]) in split_start or uri[j] == "_":
# _ prevents early split, roundtrip not generate
ns = uri[:j]
if not ns:
break
ln = uri[j:]
break
if not ns or not ln:
raise
if ns[0:-1] in namespaces:
propnode = namespaces[ns[0:-1]][ln]
else:
propnode = URIRef(v)
g.add((propnode, RDF.type, RDF.Property))
g.add((propnode, RDFS.domain, classnode))
# TODO generate range from datatype.
if isinstance(i["type"], MutableMapping):
process_type(i["type"], g, context, defaultBase, namespaces, defaultPrefix)
if "extends" in t:
for e in aslist(t["extends"]):
g.add((classnode, RDFS.subClassOf, URIRef(e)))
elif t["type"] == "enum":
_logger.debug("Processing enum %s", t.get("name"))
for i in t["symbols"]:
pred(t, None, i, context, defaultBase, namespaces)
def salad_to_jsonld_context(
j: Iterable[MutableMapping[str, Any]], schema_ctx: MutableMapping[str, Any]
) -> Tuple[ContextType, Graph]:
context = {} # type: ContextType
namespaces = {}
g = Graph()
defaultPrefix = ""
for k, v in schema_ctx.items():
context[k] = v
namespaces[k] = rdflib.namespace.Namespace(v)
if "@base" in context:
defaultBase = cast(str, context["@base"])
del context["@base"]
else:
defaultBase = ""
for k, v in namespaces.items():
g.bind(str(k), v)
for t in j:
process_type(t, g, context, defaultBase, namespaces, defaultPrefix)
return (context, g)
def fix_jsonld_ids(obj: Union[CommentedMap, float, str, CommentedSeq], ids: List[str]) -> None:
"""Add missing identity entries."""
if isinstance(obj, MutableMapping):
for i in ids:
if i in obj:
obj["@id"] = obj[i]
for v in obj.values():
fix_jsonld_ids(v, ids)
if isinstance(obj, MutableSequence):
for entry in obj:
fix_jsonld_ids(entry, ids)
def makerdf(
workflow: Optional[str],
wf: Union[CommentedMap, float, str, CommentedSeq],
ctx: ContextType,
graph: Optional[Graph] = None,
) -> Graph:
prefixes = {}
idfields = []
for k, v in ctx.items():
if isinstance(v, MutableMapping):
url = v["@id"]
else:
url = v
if url == "@id":
idfields.append(k)
doc_url, frg = urldefrag(url)
if "/" in frg:
p = frg.split("/")[0]
prefixes[p] = f"{doc_url}#{p}/"
fix_jsonld_ids(wf, idfields)
g = Graph() if graph is None else graph
if isinstance(wf, MutableSequence):
for w in wf:
w["@context"] = ctx
g.parse(
data=json_dumps(w, default=str),
format="json-ld",
publicID=str(workflow),
)
elif isinstance(wf, MutableMapping):
wf["@context"] = ctx
g.parse(data=json_dumps(wf, default=str), format="json-ld", publicID=str(workflow))
else:
raise SchemaException(f"{wf} is not a workflow")
# Bug in json-ld loader causes @id fields to be added to the graph
for sub, pred, obj in g.triples((None, URIRef("@id"), None)):
g.remove((sub, pred, obj))
for k2, v2 in prefixes.items():
g.namespace_manager.bind(k2, v2)
return g
|
/schema-salad-8.4.20230808163024.tar.gz/schema-salad-8.4.20230808163024/schema_salad/jsonld_context.py
| 0.482917 | 0.202838 |
jsonld_context.py
|
pypi
|
import os
import shutil
import string
from io import StringIO
from pathlib import Path
from typing import (
Any,
Dict,
List,
MutableMapping,
MutableSequence,
Optional,
Set,
Union,
)
from xml.sax.saxutils import escape # nosec
from importlib_resources import files
from . import _logger, schema
from .codegen_base import CodeGenBase, TypeDef
from .exceptions import SchemaException
from .java_codegen import _ensure_directory_and_write, _safe_makedirs
from .schema import shortname
def doc_to_doc_string(doc: Optional[str], indent_level: int = 0) -> str:
"""Generate a documentation string from a schema salad doc field."""
lead = "" + " " * indent_level + "/// "
if doc:
doc_str = "\n".join([f"{lead}{escape(line)}" for line in doc.split("\n")])
else:
doc_str = ""
return doc_str
_string_type_def = TypeDef(
instance_type="string",
init="new PrimitiveLoader<string>()",
name="StringInstance",
loader_type="ILoader<string>",
)
_int_type_def = TypeDef(
instance_type="int",
init="new PrimitiveLoader<int>()",
name="IntegerInstance",
loader_type="ILoader<int>",
)
_long_type_def = TypeDef(
instance_type="long",
name="LongInstance",
loader_type="ILoader<long>",
init="new PrimitiveLoader<long>()",
)
_float_type_def = TypeDef(
instance_type="double",
name="DoubleInstance",
loader_type="ILoader<double>",
init="new PrimitiveLoader<double>()",
)
_bool_type_def = TypeDef(
instance_type="bool",
name="BooleanInstance",
loader_type="ILoader<bool>",
init="new PrimitiveLoader<bool>()",
)
_null_type_def = TypeDef(
instance_type="None",
name="NullInstance",
loader_type="ILoader<object>",
init="new NullLoader()",
)
_any_type_def = TypeDef(
instance_type="object",
name="AnyInstance",
init="new AnyLoader()",
loader_type="ILoader<object>",
)
prims = {
"http://www.w3.org/2001/XMLSchema#string": _string_type_def,
"http://www.w3.org/2001/XMLSchema#int": _int_type_def,
"http://www.w3.org/2001/XMLSchema#long": _long_type_def,
"http://www.w3.org/2001/XMLSchema#float": _float_type_def,
"http://www.w3.org/2001/XMLSchema#double": _float_type_def,
"http://www.w3.org/2001/XMLSchema#boolean": _bool_type_def,
"https://w3id.org/cwl/salad#null": _null_type_def,
"https://w3id.org/cwl/salad#Any": _any_type_def,
"string": _string_type_def,
"int": _int_type_def,
"long": _long_type_def,
"float": _float_type_def,
"double": _float_type_def,
"boolean": _bool_type_def,
"null": _null_type_def,
"Any": _any_type_def,
}
class DotNetCodeGen(CodeGenBase):
"""Generation of TypeScript code for a given Schema Salad definition."""
def __init__(
self, base: str, examples: Optional[str], target: Optional[str], package: str
) -> None:
"""Initialize the TypeScript codegen."""
super().__init__()
self.target_dir = Path(target or ".").resolve()
self.main_src_dir = self.target_dir / package / "src"
self.test_src_dir = self.target_dir / "Test"
self.test_resources_dir = self.test_src_dir / "data"
self.package = package
self.base_uri = base
self.examples = examples
def prologue(self) -> None:
"""Trigger to generate the prolouge code."""
for src_dir in [self.main_src_dir]:
_safe_makedirs(src_dir)
for primitive in prims.values():
self.declare_type(primitive)
@staticmethod
def safe_name(name: str) -> str:
"""Generate a safe version of the given name."""
avn = schema.avro_field_name(name)
if avn.startswith("anon."):
avn = avn[5:]
if avn in (
"class",
"in",
"extends",
"abstract",
"default",
"package",
"arguments",
"out",
):
# reserved words
avn = avn + "_"
return avn
def begin_class(
self, # pylint: disable=too-many-arguments
classname: str,
extends: MutableSequence[str],
doc: str,
abstract: bool,
field_names: MutableSequence[str],
idfield: str,
optional_fields: Set[str],
) -> None:
"""Produce the header for the given class."""
self.current_interface = "I" + self.safe_name(classname)
cls = self.safe_name(classname)
self.current_class = cls
self.current_class_is_abstract = abstract
interface_module_name = self.current_interface
self.current_interface_target_file = self.main_src_dir / f"{interface_module_name}.cs"
class_module_name = self.current_class
self.current_class_target_file = self.main_src_dir / f"{class_module_name}.cs"
self.current_constructor_signature = StringIO()
self.current_constructor_signature_optionals = StringIO()
self.current_constructor_body = StringIO()
self.current_loader = StringIO()
self.current_serializer = StringIO()
self.current_fieldtypes: Dict[str, TypeDef] = {}
self.optional_field_names: List[str] = []
self.mandatory_field_names: List[str] = []
self.idfield = idfield
doc_string = f"""
/// <summary>
/// Auto-generated interface for {classname}
"""
if doc:
doc_string += "///\n"
doc_string += doc_to_doc_string(doc)
doc_string += "\n"
doc_string += "/// </summary>"
with open(self.current_interface_target_file, "w") as f:
_logger.info("Writing file: %s", self.current_interface_target_file)
if extends:
ext = " : " + ", ".join("I" + self.safe_name(e) for e in extends)
else:
ext = ""
f.write(
"""#pragma warning disable CS0108
namespace {package};
{docstring}
public interface {cls}{ext}
{{
""".format(
docstring=doc_string,
cls=f"{self.current_interface}",
ext=ext,
package=self.package,
)
)
if self.current_class_is_abstract:
return
doc_string = f"""
/// <summary>
/// Auto-generated class implementation for {classname}
"""
if doc:
doc_string += "///\n"
doc_string += doc_to_doc_string(doc)
doc_string += "\n"
doc_string += "/// </summary>"
with open(self.current_class_target_file, "w") as f:
_logger.info("Writing file: %s", self.current_class_target_file)
f.write(
"""using System.Collections;
using OneOf;
using OneOf.Types;
namespace {package};
{docstring}
public class {cls} : {current_interface}, ISaveable
{{
readonly LoadingOptions loadingOptions;
readonly Dictionary<object, object> extensionFields;
""".format(
cls=cls,
current_interface=self.current_interface,
docstring=doc_string,
package=self.package,
)
)
self.current_constructor_signature.write(
"\n"
+ "\n"
+ " public {cls}(".format(
cls=cls,
)
)
self.current_constructor_body.write(
"""
this.loadingOptions = loadingOptions ?? new LoadingOptions();
this.extensionFields = extensionFields ?? new Dictionary<object, object>();
"""
)
self.current_loader.write(
"""
public static ISaveable FromDoc(object doc__, string baseUri, LoadingOptions loadingOptions,
string? docRoot = null)
{
List<ValidationException> errors = new();
if (doc__ is not IDictionary)
{
throw new ValidationException("Document has to be of type Dictionary");
}
Dictionary<object, object> doc_ = ((IDictionary)doc__)
.Cast<dynamic>()
.ToDictionary(entry => entry.Key, entry => entry.Value);
"""
)
self.current_serializer.write(
"""
public Dictionary<object, object> Save(bool top = false, string baseUrl = "",
bool relativeUris = true)
{
Dictionary<object, object> r = new();
foreach (KeyValuePair<object, object> ef in extensionFields)
{
r[loadingOptions.PrefixUrl((string)ef.Value)] = ef.Value;
}
"""
)
def end_class(self, classname: str, field_names: List[str]) -> None:
"""Signal that we are done with this class."""
with open(self.current_interface_target_file, "a") as f:
f.write("}\n")
if self.current_class_is_abstract:
return
self.current_constructor_signature.write(
self.current_constructor_signature_optionals.getvalue()
)
self.current_constructor_signature.write(
"LoadingOptions? loadingOptions = null, "
"Dictionary<object, object>? extensionFields = null)"
"\n "
"{"
)
self.current_constructor_body.write(" }\n")
self.current_loader.write(
"""
Dictionary<object, object> extensionFields = new();
foreach (KeyValuePair<object, object> v in doc_)
{{
if (!attr.Contains(v.Key))
{{
if (((string)v.Key).Contains(':'))
{{
string ex = loadingOptions.ExpandUrl((string)v.Key, "", false, false, null);
extensionFields[ex] = v.Value;
}}
else
{{
errors.Add(
new ValidationException($"invalid field {{v.Key}}," +
"expected one of {fields}"));
break;
}}
}}
}}
if (errors.Count > 0)
{{
throw new ValidationException("", errors);
}}
{classname} res__ = new(
""".format(
classname=self.current_class,
fields=", ".join(["`" + f + "`" for f in field_names]),
)
)
self.current_loader.write("loadingOptions: loadingOptions")
if len(self.mandatory_field_names) > 0:
self.current_loader.write(
",\n "
+ ",\n ".join(f + ": " + f for f in self.mandatory_field_names)
)
self.current_loader.write("\n );\n")
for optionalField in self.optional_field_names:
self.current_loader.write(
f"""
if ({optionalField} != null)
{{
res__.{optionalField} = {optionalField};
}}
"""
)
self.current_loader.write("\n return res__;")
self.current_loader.write("\n " + "}" + "\n")
self.current_serializer.write(
"""
if (top)
{
if (loadingOptions.namespaces != null)
{
r["$namespaces"] = loadingOptions.namespaces;
}
if (this.loadingOptions.schemas != null)
{
r["$schemas"] = loadingOptions.schemas;
}
}
return r;
}
"""
)
with open(
self.current_class_target_file,
"a",
) as f:
f.write(self.current_constructor_signature.getvalue())
f.write(self.current_constructor_body.getvalue())
f.write(self.current_loader.getvalue())
f.write(self.current_serializer.getvalue())
f.write(
" static readonly System.Collections.Generic.HashSet<string>"
+ " attr = new() { "
+ ", ".join(['"' + shortname(f) + '"' for f in field_names])
+ " };"
)
f.write(
"""
}
"""
)
def type_loader(self, type_declaration: Union[List[Any], Dict[str, Any], str]) -> TypeDef:
"""Parse the given type declaration and declare its components."""
if isinstance(type_declaration, MutableSequence):
sub_types = [self.type_loader(i) for i in type_declaration]
sub_names: List[str] = list(dict.fromkeys([i.name for i in sub_types]))
sub_instance_types: List[str] = list(
dict.fromkeys([i.instance_type for i in sub_types if i.instance_type is not None])
)
return self.declare_type(
TypeDef(
name="union_of_{}".format("_or_".join(sub_names)),
init="new UnionLoader(new List<ILoader> {{ {} }})".format(", ".join(sub_names)),
instance_type="OneOf<" + ", ".join(sub_instance_types) + ">",
loader_type="ILoader<object>",
)
)
if isinstance(type_declaration, MutableMapping):
if type_declaration["type"] in (
"array",
"https://w3id.org/cwl/salad#array",
):
i = self.type_loader(type_declaration["items"])
return self.declare_type(
TypeDef(
instance_type=f"List<{i.instance_type}>",
name=f"array_of_{i.name}",
loader_type=f"ILoader<List<{i.instance_type}>>",
init=f"new ArrayLoader<{i.instance_type}>({i.name})",
)
)
if type_declaration["type"] in ("enum", "https://w3id.org/cwl/salad#enum"):
return self.type_loader_enum(type_declaration)
if type_declaration["type"] in (
"record",
"https://w3id.org/cwl/salad#record",
):
return self.declare_type(
TypeDef(
instance_type=self.safe_name(type_declaration["name"]),
name=self.safe_name(type_declaration["name"]) + "Loader",
init="new RecordLoader<{}>()".format(
self.safe_name(type_declaration["name"]),
),
loader_type="ILoader<{}>".format(self.safe_name(type_declaration["name"])),
abstract=type_declaration.get("abstract", False),
)
)
raise SchemaException("wft {}".format(type_declaration["type"]))
if type_declaration in prims:
return prims[type_declaration]
if type_declaration in ("Expression", "https://w3id.org/cwl/cwl#Expression"):
return self.declare_type(
TypeDef(
name=self.safe_name(type_declaration) + "Loader",
init="new ExpressionLoader()",
loader_type="ILoader<string>",
instance_type="string",
)
)
return self.collected_types[self.safe_name(type_declaration) + "Loader"]
def type_loader_enum(self, type_declaration: Dict[str, Any]) -> TypeDef:
for sym in type_declaration["symbols"]:
self.add_vocab(shortname(sym), sym)
enum_name = self.safe_name(type_declaration["name"])
enum_module_name = enum_name
enum_path = self.main_src_dir / f"{enum_module_name}.cs"
with open(enum_path, "w") as f:
_logger.info("Writing file: %s", enum_path)
f.write(
"""namespace {package};
public class {enum_name} : IEnumClass<{enum_name}>
{{
private string _Name;
private static readonly List<{enum_name}> members = new();
""".format(
enum_name=enum_name, package=self.package
)
)
for sym in type_declaration["symbols"]:
const = self.safe_name(sym).replace("-", "_").replace(".", "_").upper()
f.write(
""" public static readonly {enum_name} {const} =
new("{val}");\n""".format(
const=const, val=self.safe_name(sym), enum_name=enum_name
)
)
f.write(
"""
public string Name
{{
get {{ return _Name; }}
private set {{ _Name = value; }}
}}
public static IList<{enum_name}> Members
{{
get {{ return members; }}
}}
private {enum_name}(string name)
{{
_Name = name;
members.Add(this);
}}
public static {enum_name} Parse(string toParse)
{{
foreach ({enum_name} s in Members)
{{
if (toParse == s.Name)
return s;
}}
throw new FormatException("Could not parse string.");
}}
public static bool Contains(string value)
{{
bool contains = false;
foreach ({enum_name} s in Members)
{{
if (value == s.Name)
{{
contains = true;
return contains;
}}
}}
return contains;
}}
public static List<string> Symbols()
{{
return members.Select(m => m.Name).ToList();
}}
public override string ToString()
{{
return _Name;
}}
}}
""".format(
enum_name=enum_name
)
)
return self.declare_type(
TypeDef(
instance_type=enum_name,
name=self.safe_name(type_declaration["name"] + "Loader"),
init=f"new EnumLoader<{enum_name}>()",
loader_type=f"ILoader<{enum_name}>",
)
)
def declare_field(
self,
name: str,
fieldtype: TypeDef,
doc: Optional[str],
optional: bool,
subscope: str,
) -> None:
"""Output the code to load the given field."""
if self.current_class_is_abstract:
return
safename = self.safe_name(name)
fieldname = shortname(name)
self.current_fieldtypes[safename] = fieldtype
if optional:
self.optional_field_names.append(safename)
if fieldtype.instance_type is not None and not fieldtype.instance_type.startswith(
"OneOf<None"
):
optionalstring = "?"
else:
optionalstring = ""
else:
self.mandatory_field_names.append(safename)
optionalstring = ""
with open(self.current_class_target_file, "a") as f:
if doc:
f.write(
"""
/// <summary>
{doc_str}
/// </summary>
""".format(
doc_str=doc_to_doc_string(doc, indent_level=1)
)
)
f.write(
" public {type}{optionalstring} {safename} {{ get; set; }}\n".format(
safename=safename,
type=fieldtype.instance_type,
optionalstring=optionalstring,
)
)
if fieldname == "class":
if fieldtype.instance_type == "string":
self.current_constructor_signature_optionals.write(
'string {safename} = "{val}", '.format(
safename=safename, val=self.current_class
)
)
else:
self.current_constructor_signature_optionals.write(
"{type}? {safename} = null, ".format(
safename=safename, type=fieldtype.instance_type
)
)
else:
if not optional:
self.current_constructor_signature.write(
"{type} {safename}, ".format(
safename=safename,
type=fieldtype.instance_type,
)
)
else:
if fieldtype.instance_type is not None and fieldtype.instance_type.startswith(
"OneOf<None"
):
self.current_constructor_signature_optionals.write(
"{type} {safename} = default, ".format(
safename=safename,
type=fieldtype.instance_type,
)
)
else:
self.current_constructor_signature_optionals.write(
"{type}? {safename} = null, ".format(
safename=safename,
type=fieldtype.instance_type,
)
)
if fieldname == "class" and fieldtype.instance_type != "string":
self.current_constructor_body.write(
" this.{safeName} = {safeName} ?? {type}.{val};\n".format(
safeName=safename,
type=fieldtype.instance_type,
val=self.current_class.replace("-", "_").replace(".", "_").upper(),
)
)
else:
self.current_constructor_body.write(
" this.{safeName} = {safeName};\n".format(safeName=safename)
)
self.current_loader.write(
"""
dynamic {safename} = default!;""".format(
safename=safename
)
)
if optional:
self.current_loader.write(
"""
if (doc_.ContainsKey("{fieldname}"))
{{""".format(
fieldname=fieldname
)
)
spc = " "
else:
spc = " "
self.current_loader.write(
"""
{spc} try
{spc} {{
{spc} {safename} = LoaderInstances.{fieldtype}
{spc} .LoadField(doc_.GetValueOrDefault("{fieldname}", null!), baseUri,
{spc} loadingOptions);
{spc} }}
{spc} catch (ValidationException e)
{spc} {{
{spc} errors.Add(
{spc} new ValidationException("the `{fieldname}` field is not valid because: ", e)
{spc} );
{spc} }}
""".format(
safename=safename,
fieldname=fieldname,
fieldtype=fieldtype.name,
spc=spc,
)
)
if optional:
self.current_loader.write(" }\n")
if name == self.idfield or not self.idfield:
baseurl = "baseUrl"
elif self.id_field_type.instance_type is not None:
if self.id_field_type.instance_type.startswith("OneOf"):
baseurl = (
f"(this.{self.safe_name(self.idfield)}.Value is "
f'None ? "" : {self.safe_name(self.idfield)}.Value)'
)
else:
baseurl = f"this.{self.safe_name(self.idfield)}"
if fieldtype.is_uri:
self.current_serializer.write(
"""
object? {safename}Val = ISaveable.SaveRelativeUri({safename}, {scoped_id},
relativeUris, {ref_scope}, (string){base_url}!);
if ({safename}Val is not null)
{{
r["{fieldname}"] = {safename}Val;
}}
""".format(
safename=self.safe_name(name),
fieldname=shortname(name).strip(),
base_url=baseurl,
scoped_id=self.to_dotnet(fieldtype.scoped_id),
ref_scope=self.to_dotnet(fieldtype.ref_scope),
)
)
else:
self.current_serializer.write(
"""
object? {safename}Val = ISaveable.Save({safename},
false, (string){base_url}!, relativeUris);
if ({safename}Val is not null)
{{
r["{fieldname}"] = {safename}Val;
}}
""".format(
safename=self.safe_name(name),
fieldname=shortname(name).strip(),
base_url=baseurl,
)
)
def declare_id_field(
self,
name: str,
fieldtype: TypeDef,
doc: str,
optional: bool,
) -> None:
"""Output the code to handle the given ID field."""
self.id_field_type = fieldtype
if self.current_class_is_abstract:
return
self.declare_field(name, fieldtype, doc, True, "")
if optional:
opt = f"""{self.safe_name(name)} = "_" + Guid.NewGuid();"""
else:
opt = """throw new ValidationException("Missing {fieldname}");""".format(
fieldname=shortname(name)
)
self.current_loader.write(
"""
if ({safename} == null)
{{
if (docRoot != null)
{{
{safename} = docRoot;
}}
else
{{
{opt}
}}
}}
else
{{
baseUri = (string){safename};
}}
""".format(
safename=self.safe_name(name), opt=opt
)
)
def to_dotnet(self, val: Any) -> Any:
"""Convert a Python keyword to a DotNet keyword."""
if val is True:
return "true"
elif val is None:
return "null"
elif val is False:
return "false"
return val
def uri_loader(
self,
inner: TypeDef,
scoped_id: bool,
vocab_term: bool,
ref_scope: Optional[int],
) -> TypeDef:
"""Construct the TypeDef for the given URI loader."""
instance_type = inner.instance_type or "object"
return self.declare_type(
TypeDef(
instance_type=instance_type,
name=f"uri{inner.name}{scoped_id}{vocab_term}{ref_scope}",
loader_type="ILoader<object>",
init="new UriLoader({}, {}, {}, {})".format(
inner.name,
self.to_dotnet(scoped_id),
self.to_dotnet(vocab_term),
self.to_dotnet(ref_scope),
),
is_uri=True,
scoped_id=scoped_id,
ref_scope=ref_scope,
)
)
def idmap_loader(
self, field: str, inner: TypeDef, map_subject: str, map_predicate: Optional[str]
) -> TypeDef:
"""Construct the TypeDef for the given mapped ID loader."""
instance_type = inner.instance_type or "object"
return self.declare_type(
TypeDef(
instance_type=instance_type,
name=f"idmap{self.safe_name(field)}{inner.name}",
loader_type="ILoader<object>",
init='new IdMapLoader({}, "{}", "{}")'.format(
inner.name, map_subject, map_predicate
),
)
)
def typedsl_loader(self, inner: TypeDef, ref_scope: Optional[int]) -> TypeDef:
"""Construct the TypeDef for the given DSL loader."""
instance_type = inner.instance_type or "object"
return self.declare_type(
TypeDef(
instance_type=instance_type,
name=f"typedsl{self.safe_name(inner.name)}{ref_scope}",
loader_type="ILoader<object>",
init=(f"new TypeDSLLoader" f"({self.safe_name(inner.name)}, {ref_scope})"),
)
)
def epilogue(self, root_loader: TypeDef) -> None:
"""Trigger to generate the epilouge code."""
pd = "This project contains .Net objects and utilities "
pd = pd + ' auto-generated by <a href="https://github.com/'
pd = pd + 'common-workflow-language/schema_salad">Schema Salad</a>'
pd = pd + " for parsing documents corresponding to the "
pd = pd + str(self.base_uri) + " schema."
template_vars: MutableMapping[str, str] = dict(
project_name=self.package,
version="0.0.1-SNAPSHOT",
project_description=pd,
license_name="Apache License, Version 2.0",
)
def template_from_resource(resource: Path) -> string.Template:
template_str = resource.read_text("utf-8")
template = string.Template(template_str)
return template
def expand_resource_template_to(resource: str, path: Path) -> None:
template = template_from_resource(files("schema_salad").joinpath(f"dotnet/{resource}"))
src = template.safe_substitute(template_vars)
_ensure_directory_and_write(path, src)
expand_resource_template_to("editorconfig", self.target_dir / ".editorconfig")
expand_resource_template_to("gitignore", self.target_dir / ".gitignore")
expand_resource_template_to("LICENSE", self.target_dir / "LICENSE")
expand_resource_template_to("README.md", self.target_dir / "README.md")
expand_resource_template_to("Solution.sln", self.target_dir / "Solution.sln")
expand_resource_template_to(
"Project.csproj.template",
self.target_dir / self.package / Path(self.package + ".csproj"),
)
expand_resource_template_to(
"Test.csproj.template",
self.test_src_dir / "Test.csproj",
)
expand_resource_template_to(
"docfx.json",
self.target_dir / self.package / "docfx.json",
)
expand_resource_template_to(
"AssemblyInfo.cs",
self.target_dir / self.package / "Properties" / "AssemblyInfo.cs",
)
vocab = ",\n ".join(
f"""["{k}"] = "{self.vocab[k]}\"""" for k in sorted(self.vocab.keys()) # noqa: B907
)
rvocab = ",\n ".join(
f"""["{self.vocab[k]}"] = "{k}\"""" for k in sorted(self.vocab.keys()) # noqa: B907
)
loader_instances = ""
for _, collected_type in self.collected_types.items():
if not collected_type.abstract:
loader_instances += " internal static readonly {} {} = {};\n".format(
collected_type.loader_type, collected_type.name, collected_type.init
)
example_tests = ""
if self.examples:
_safe_makedirs(self.test_resources_dir)
utils_resources = self.test_resources_dir / "examples"
if os.path.exists(utils_resources):
shutil.rmtree(utils_resources)
shutil.copytree(self.examples, utils_resources)
for example_name in os.listdir(self.examples):
if example_name.startswith("valid"):
basename = os.path.basename(example_name).rsplit(".", 1)[0]
example_tests += """
[TestMethod]
public void Test{basename}()
{{
string? file = System.IO.File.ReadAllText("data/examples/{example_name}");
RootLoader.LoadDocument(file!,
new Uri(Path.GetFullPath("data/examples/{example_name}")).AbsoluteUri);
}}
""".format(
basename=basename.replace("-", "_").replace(".", "_"),
example_name=example_name,
)
template_args: MutableMapping[str, str] = dict(
project_name=self.package,
loader_instances=loader_instances,
vocab=vocab,
rvocab=rvocab,
root_loader=root_loader.name,
root_loader_type=root_loader.instance_type or "object",
tests=example_tests,
project_description=pd,
)
util_src_dirs = {
"util": self.main_src_dir / "util",
"Test": self.test_src_dir,
"DocFx": self.target_dir / "DocFx",
}
def copy_utils_recursive(util_src: str, util_target: Path) -> None:
for util in files("schema_salad").joinpath(f"dotnet/{util_src}").iterdir():
if util.is_dir():
copy_utils_recursive(os.path.join(util_src, util.name), util_target / util.name)
continue
src_path = util_target / util.name
src_template = template_from_resource(util)
src = src_template.safe_substitute(template_args)
_ensure_directory_and_write(src_path, src)
for util_src, util_target in util_src_dirs.items():
copy_utils_recursive(util_src, util_target)
def secondaryfilesdsl_loader(self, inner: TypeDef) -> TypeDef:
"""Construct the TypeDef for secondary files."""
instance_type = inner.instance_type or "any"
return self.declare_type(
TypeDef(
name=f"secondaryfilesdsl{inner.name}",
init=f"new SecondaryDSLLoader({inner.name})",
loader_type="ILoader<object>",
instance_type=instance_type,
)
)
|
/schema-salad-8.4.20230808163024.tar.gz/schema-salad-8.4.20230808163024/schema_salad/dotnet_codegen.py
| 0.680135 | 0.154121 |
dotnet_codegen.py
|
pypi
|
import os
import re
from typing import (
Any,
AnyStr,
Callable,
List,
MutableMapping,
MutableSequence,
Optional,
Tuple,
Union,
)
import ruamel.yaml
from ruamel.yaml.comments import CommentedBase, CommentedMap, CommentedSeq
lineno_re = re.compile("^(.*?:[0-9]+:[0-9]+: )(( *)(.*))")
def _add_lc_filename(r: ruamel.yaml.comments.CommentedBase, source: AnyStr) -> None:
if isinstance(r, ruamel.yaml.comments.CommentedBase):
r.lc.filename = source
if isinstance(r, MutableSequence):
for d in r:
_add_lc_filename(d, source)
elif isinstance(r, MutableMapping):
for d in r.values():
_add_lc_filename(d, source)
def relname(source: str) -> str:
if source.startswith("file://"):
source = source[7:]
source = os.path.relpath(source)
return source
def add_lc_filename(r: ruamel.yaml.comments.CommentedBase, source: str) -> None:
_add_lc_filename(r, relname(source))
def reflow_all(text: str, maxline: Optional[int] = None) -> str:
if maxline is None:
maxline = int(os.environ.get("COLUMNS", "100"))
maxno = 0
for line in text.splitlines():
g = lineno_re.match(line)
if not g:
continue
group = g.group(1)
assert group is not None # nosec
maxno = max(maxno, len(group))
maxno_text = maxline - maxno
msg = [] # type: List[str]
for line in text.splitlines():
g = lineno_re.match(line)
if not g:
msg.append(line)
continue
pre = g.group(1)
assert pre is not None # nosec
group2 = g.group(2)
assert group2 is not None # nosec
reflowed = reflow(group2, maxno_text, g.group(3)).splitlines()
msg.extend([pre.ljust(maxno, " ") + r for r in reflowed])
return "\n".join(msg)
def reflow(text: str, maxline: int, shift: Optional[str] = "") -> str:
maxline = max(maxline, 20)
if len(text) > maxline:
sp = text.rfind(" ", 0, maxline)
if sp < 1:
sp = text.find(" ", sp + 1)
if sp == -1:
sp = len(text)
if sp < len(text):
return f"{text[0:sp]}\n{shift}{reflow(text[sp + 1 :], maxline, shift)}"
return text
def indent(v: str, nolead: bool = False, shift: str = " ", bullet: str = " ") -> str:
if nolead:
return v.splitlines()[0] + "\n".join([shift + line for line in v.splitlines()[1:]])
def lineno(i: int, line: str) -> str:
r = lineno_re.match(line)
if r is not None:
group1 = r.group(1)
group2 = r.group(2)
assert group1 is not None # nosec
assert group2 is not None # nosec
return group1 + (bullet if i == 0 else shift) + group2
return (bullet if i == 0 else shift) + line
return "\n".join([lineno(i, line) for i, line in enumerate(v.splitlines())])
def bullets(textlist: List[str], bul: str) -> str:
if len(textlist) == 1:
return textlist[0]
return "\n".join(indent(t, bullet=bul) for t in textlist)
def strip_duplicated_lineno(text: str) -> str:
"""
Strip duplicated line numbers.
Same as :py:meth:`strip_dup_lineno` but without reflow.
"""
pre = None # type: Optional[str]
msg = []
for line in text.splitlines():
g = lineno_re.match(line)
if not g:
msg.append(line)
continue
if g.group(1) != pre:
msg.append(line)
pre = g.group(1)
else:
group1 = g.group(1)
group2 = g.group(2)
assert group1 is not None # nosec
assert group2 is not None # nosec
msg.append(" " * len(group1) + group2)
return "\n".join(msg)
def strip_dup_lineno(text: str, maxline: Optional[int] = None) -> str:
if maxline is None:
maxline = int(os.environ.get("COLUMNS", "100"))
pre = None # type: Optional[str]
msg = []
maxno = 0
for line in text.splitlines():
g = lineno_re.match(line)
if not g:
continue
group1 = g.group(1)
assert group1 is not None # nosec
maxno = max(maxno, len(group1))
for line in text.splitlines():
g = lineno_re.match(line)
if not g:
msg.append(line)
continue
if g.group(1) != pre:
group3 = g.group(3)
assert group3 is not None # nosec
shift = maxno + len(group3)
group2 = g.group(2)
assert group2 is not None # nosec
g2 = reflow(group2, maxline - shift, " " * shift)
pre = g.group(1)
assert pre is not None # nosec
msg.append(pre + " " * (maxno - len(pre)) + g2)
else:
group2 = g.group(2)
assert group2 is not None # nosec
group3 = g.group(3)
assert group3 is not None # nosec
g2 = reflow(group2, maxline - maxno, " " * (maxno + len(group3)))
msg.append(" " * maxno + g2)
return "\n".join(msg)
def cmap(
d: Union[int, float, str, MutableMapping[str, Any], MutableSequence[Any], None],
lc: Optional[List[int]] = None,
fn: Optional[str] = None,
) -> Union[int, float, str, CommentedMap, CommentedSeq, None]:
if lc is None:
lc = [0, 0, 0, 0]
if fn is None:
fn = "test"
if isinstance(d, CommentedMap):
fn = d.lc.filename if hasattr(d.lc, "filename") else fn
for k, v in d.items():
if d.lc.data is not None and k in d.lc.data:
d[k] = cmap(v, lc=d.lc.data[k], fn=fn)
else:
d[k] = cmap(v, lc, fn=fn)
return d
if isinstance(d, CommentedSeq):
fn = d.lc.filename if hasattr(d.lc, "filename") else fn
for k2, v2 in enumerate(d):
if d.lc.data is not None and k2 in d.lc.data:
d[k2] = cmap(v2, lc=d.lc.data[k2], fn=fn)
else:
d[k2] = cmap(v2, lc, fn=fn)
return d
if isinstance(d, MutableMapping):
cm = CommentedMap()
for k in sorted(d.keys()):
v = d[k]
if isinstance(v, CommentedBase):
uselc = [v.lc.line, v.lc.col, v.lc.line, v.lc.col]
vfn = v.lc.filename if hasattr(v.lc, "filename") else fn
else:
uselc = lc
vfn = fn
cm[k] = cmap(v, lc=uselc, fn=vfn)
cm.lc.add_kv_line_col(k, uselc)
cm.lc.filename = fn
return cm
if isinstance(d, MutableSequence):
cs = CommentedSeq()
for k3, v3 in enumerate(d):
if isinstance(v3, CommentedBase):
uselc = [v3.lc.line, v3.lc.col, v3.lc.line, v3.lc.col]
vfn = v3.lc.filename if hasattr(v3.lc, "filename") else fn
else:
uselc = lc
vfn = fn
cs.append(cmap(v3, lc=uselc, fn=vfn))
cs.lc.add_kv_line_col(k3, uselc)
cs.lc.filename = fn
return cs
return d
class SourceLine:
def __init__(
self,
item: Any,
key: Optional[Any] = None,
raise_type: Callable[[str], Any] = str,
include_traceback: bool = False,
) -> None:
self.item = item
self.key = key
self.raise_type = raise_type
self.include_traceback = include_traceback
def __enter__(self) -> "SourceLine":
return self
def __exit__(
self,
exc_type: Any,
exc_value: Any,
tb: Any,
) -> None:
if not exc_value:
return
raise self.makeError(str(exc_value)) from exc_value
def file(self) -> Optional[str]:
if hasattr(self.item, "lc") and hasattr(self.item.lc, "filename"):
return str(self.item.lc.filename)
return None
def start(self) -> Optional[Tuple[int, int]]:
if self.file() is None:
return None
if self.key is None or self.item.lc.data is None or self.key not in self.item.lc.data:
return ((self.item.lc.line or 0) + 1, (self.item.lc.col or 0) + 1)
return (
(self.item.lc.data[self.key][0] or 0) + 1,
(self.item.lc.data[self.key][1] or 0) + 1,
)
def end(self) -> Optional[Tuple[int, int]]:
return None
def makeLead(self) -> str:
if self.file():
lcol = self.start()
line, col = lcol if lcol else ("", "")
return f"{self.file()}:{line}:{col}:"
return ""
def makeError(self, msg: str) -> Any:
if not isinstance(self.item, ruamel.yaml.comments.CommentedBase):
return self.raise_type(msg)
errs = []
lead = self.makeLead()
for m in msg.splitlines():
if bool(lineno_re.match(m)):
errs.append(m)
else:
errs.append(f"{lead} {m}")
return self.raise_type("\n".join(errs))
|
/schema-salad-8.4.20230808163024.tar.gz/schema-salad-8.4.20230808163024/schema_salad/sourceline.py
| 0.567697 | 0.190479 |
sourceline.py
|
pypi
|
import copy
import hashlib
from typing import (
IO,
Any,
Dict,
List,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Set,
Tuple,
TypeVar,
Union,
cast,
)
from urllib.parse import urlparse
from importlib_resources import files
from ruamel.yaml.comments import CommentedMap, CommentedSeq
from schema_salad.utils import (
CacheType,
ResolveType,
add_dictlist,
aslist,
convert_to_dict,
flatten,
json_dumps,
yaml_no_ts,
)
from . import _logger, jsonld_context, ref_resolver, validate
from .avro.schema import Names, SchemaParseException, is_subtype, make_avsc_object
from .exceptions import (
ClassValidationException,
SchemaSaladException,
ValidationException,
)
from .ref_resolver import Loader
from .sourceline import SourceLine, add_lc_filename, relname
SALAD_FILES = (
"metaschema.yml",
"metaschema_base.yml",
"salad.md",
"field_name.yml",
"import_include.md",
"link_res.yml",
"ident_res.yml",
"vocab_res.yml",
"vocab_res.yml",
"field_name_schema.yml",
"field_name_src.yml",
"field_name_proc.yml",
"ident_res_schema.yml",
"ident_res_src.yml",
"ident_res_proc.yml",
"link_res_schema.yml",
"link_res_src.yml",
"link_res_proc.yml",
"vocab_res_schema.yml",
"vocab_res_src.yml",
"vocab_res_proc.yml",
"map_res.yml",
"map_res_schema.yml",
"map_res_src.yml",
"map_res_proc.yml",
"typedsl_res.yml",
"typedsl_res_schema.yml",
"typedsl_res_src.yml",
"typedsl_res_proc.yml",
"sfdsl_res.yml",
"sfdsl_res_schema.yml",
"sfdsl_res_src.yml",
"sfdsl_res_proc.yml",
)
saladp = "https://w3id.org/cwl/salad#"
cached_metaschema: Optional[Tuple[Names, List[Dict[str, str]], Loader]] = None
def get_metaschema() -> Tuple[Names, List[Dict[str, str]], Loader]:
"""Instantiate the metaschema."""
global cached_metaschema
if cached_metaschema is not None:
return cached_metaschema
loader = ref_resolver.Loader(
{
"Any": saladp + "Any",
"ArraySchema": saladp + "ArraySchema",
"Array_symbol": saladp + "ArraySchema/type/Array_symbol",
"DocType": saladp + "DocType",
"Documentation": saladp + "Documentation",
"Documentation_symbol": saladp + "Documentation/type/Documentation_symbol",
"Documented": saladp + "Documented",
"EnumSchema": saladp + "EnumSchema",
"Enum_symbol": saladp + "EnumSchema/type/Enum_symbol",
"JsonldPredicate": saladp + "JsonldPredicate",
"NamedType": saladp + "NamedType",
"PrimitiveType": saladp + "PrimitiveType",
"RecordField": saladp + "RecordField",
"RecordSchema": saladp + "RecordSchema",
"Record_symbol": saladp + "RecordSchema/type/Record_symbol",
"SaladEnumSchema": saladp + "SaladEnumSchema",
"SaladRecordField": saladp + "SaladRecordField",
"SaladRecordSchema": saladp + "SaladRecordSchema",
"SchemaDefinedType": saladp + "SchemaDefinedType",
"SpecializeDef": saladp + "SpecializeDef",
"_container": saladp + "JsonldPredicate/_container",
"_id": {"@id": saladp + "_id", "@type": "@id", "identity": True},
"_type": saladp + "JsonldPredicate/_type",
"abstract": saladp + "SaladRecordSchema/abstract",
"array": saladp + "array",
"boolean": "http://www.w3.org/2001/XMLSchema#boolean",
"dct": "http://purl.org/dc/terms/",
"default": {"@id": saladp + "default", "noLinkCheck": True},
"doc": "rdfs:comment",
"docAfter": {"@id": saladp + "docAfter", "@type": "@id"},
"docChild": {"@id": saladp + "docChild", "@type": "@id"},
"docParent": {"@id": saladp + "docParent", "@type": "@id"},
"documentRoot": saladp + "SchemaDefinedType/documentRoot",
"documentation": saladp + "documentation",
"double": "http://www.w3.org/2001/XMLSchema#double",
"enum": saladp + "enum",
"extends": {"@id": saladp + "extends", "@type": "@id", "refScope": 1},
"fields": {
"@id": saladp + "fields",
"mapPredicate": "type",
"mapSubject": "name",
},
"float": "http://www.w3.org/2001/XMLSchema#float",
"identity": saladp + "JsonldPredicate/identity",
"inVocab": saladp + "NamedType/inVocab",
"int": "http://www.w3.org/2001/XMLSchema#int",
"items": {"@id": saladp + "items", "@type": "@vocab", "refScope": 2},
"jsonldPredicate": "sld:jsonldPredicate",
"long": "http://www.w3.org/2001/XMLSchema#long",
"mapPredicate": saladp + "JsonldPredicate/mapPredicate",
"mapSubject": saladp + "JsonldPredicate/mapSubject",
"name": "@id",
"noLinkCheck": saladp + "JsonldPredicate/noLinkCheck",
"null": saladp + "null",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"record": saladp + "record",
"refScope": saladp + "JsonldPredicate/refScope",
"sld": saladp,
"specialize": {
"@id": saladp + "specialize",
"mapPredicate": "specializeTo",
"mapSubject": "specializeFrom",
},
"specializeFrom": {
"@id": saladp + "specializeFrom",
"@type": "@id",
"refScope": 1,
},
"specializeTo": {
"@id": saladp + "specializeTo",
"@type": "@id",
"refScope": 1,
},
"string": "http://www.w3.org/2001/XMLSchema#string",
"subscope": saladp + "JsonldPredicate/subscope",
"symbols": {"@id": saladp + "symbols", "@type": "@id", "identity": True},
"type": {
"@id": saladp + "type",
"@type": "@vocab",
"refScope": 2,
"typeDSL": True,
},
"typeDSL": saladp + "JsonldPredicate/typeDSL",
"xsd": "http://www.w3.org/2001/XMLSchema#",
},
salad_version="v1.3",
)
for salad in SALAD_FILES:
loader.cache["https://w3id.org/cwl/" + salad] = (
files("schema_salad").joinpath("metaschema/" + salad).read_text("UTF-8")
)
loader.cache["https://w3id.org/cwl/salad"] = (
files("schema_salad").joinpath("metaschema/metaschema.yml").read_text("UTF-8")
)
yaml = yaml_no_ts()
j = yaml.load(loader.cache["https://w3id.org/cwl/salad"])
add_lc_filename(j, "metaschema.yml")
j2 = loader.resolve_all(j, saladp)[0]
if not isinstance(j2, list):
_logger.error("%s", j2)
raise SchemaParseException(f"Not a list: {j2}")
sch_obj = make_avro(j2, loader, loader.vocab)
try:
sch_names = make_avro_schema_from_avro(sch_obj)
except SchemaParseException:
_logger.error("Metaschema error, avro was:\n%s", json_dumps(sch_obj, indent=4))
raise
validate_doc(sch_names, j2, loader, strict=True)
cached_metaschema = (sch_names, j2, loader)
return cached_metaschema
def add_namespaces(metadata: Mapping[str, Any], namespaces: MutableMapping[str, str]) -> None:
"""Collect the provided namespaces, checking for conflicts."""
for key, value in metadata.items():
if key not in namespaces:
namespaces[key] = value
elif namespaces[key] != value:
raise ValidationException(
f"Namespace prefix {key!r} has conflicting definitions {namespaces[key]!r}"
" and {value!r}."
)
def collect_namespaces(metadata: Mapping[str, Any]) -> Dict[str, str]:
"""Walk through the metadata object, collecting namespace declarations."""
namespaces = {} # type: Dict[str, str]
if "$import_metadata" in metadata:
for value in metadata["$import_metadata"].values():
add_namespaces(collect_namespaces(value), namespaces)
if "$namespaces" in metadata:
add_namespaces(metadata["$namespaces"], namespaces)
return namespaces
schema_type = Tuple[Loader, Union[Names, SchemaParseException], Dict[str, Any], Loader]
def load_schema(
schema_ref: ResolveType,
cache: Optional[CacheType] = None,
) -> schema_type:
"""
Load a schema that can be used to validate documents using load_and_validate.
:returns: document_loader, avsc_names, schema_metadata, metaschema_loader
"""
metaschema_names, _metaschema_doc, metaschema_loader = get_metaschema()
if cache is not None:
# we want to replace some items in the cache, so we need to
# make a new Loader with an empty index.
for k, v in metaschema_loader.cache.items():
if k not in cache:
cache[k] = v
metaschema_loader = Loader(
ctx=metaschema_loader.ctx, cache=cache, session=metaschema_loader.session
)
schema_doc, schema_metadata = metaschema_loader.resolve_ref(schema_ref, "")
if not isinstance(schema_doc, MutableSequence):
raise ValidationException("Schema reference must resolve to a list.")
validate_doc(metaschema_names, schema_doc, metaschema_loader, True)
metactx = schema_metadata.get("@context", {})
metactx.update(collect_namespaces(schema_metadata))
schema_ctx = jsonld_context.salad_to_jsonld_context(schema_doc, metactx)[0]
# Create the loader that will be used to load the target document.
document_loader = Loader(schema_ctx, cache=cache)
# Make the Avro validation that will be used to validate the target
# document
avsc_names = make_avro_schema(schema_doc, document_loader, metaschema_loader.vocab)
return document_loader, avsc_names, schema_metadata, metaschema_loader
def load_and_validate(
document_loader: Loader,
avsc_names: Names,
document: Union[CommentedMap, str],
strict: bool,
strict_foreign_properties: bool = False,
) -> Tuple[Any, Dict[str, Any]]:
"""Load a document and validate it with the provided schema.
return data, metadata
"""
try:
if isinstance(document, CommentedMap):
data, metadata = document_loader.resolve_all(
document,
document["id"],
checklinks=True,
strict_foreign_properties=strict_foreign_properties,
)
else:
data, metadata = document_loader.resolve_ref(
document,
checklinks=True,
strict_foreign_properties=strict_foreign_properties,
)
validate_doc(
avsc_names,
data,
document_loader,
strict,
strict_foreign_properties=strict_foreign_properties,
)
except ValidationException as exc:
raise ValidationException("", None, [exc]) from exc
return data, metadata
def validate_doc(
schema_names: Names,
doc: ResolveType,
loader: Loader,
strict: bool,
strict_foreign_properties: bool = False,
) -> None:
"""Validate a document using the provided schema."""
has_root = False
for root in schema_names.names.values():
if (hasattr(root, "get_prop") and root.get_prop("documentRoot")) or (
"documentRoot" in root.props
):
has_root = True
break
if not has_root:
raise ValidationException("No document roots defined in the schema")
if isinstance(doc, MutableSequence):
vdoc = doc
elif isinstance(doc, CommentedMap):
vdoc = CommentedSeq([doc])
vdoc.lc.add_kv_line_col(0, [doc.lc.line, doc.lc.col])
vdoc.lc.filename = doc.lc.filename
else:
raise ValidationException("Document must be dict or list")
roots = []
for root in schema_names.names.values():
if (hasattr(root, "get_prop") and root.get_prop("documentRoot")) or (
root.props.get("documentRoot")
):
roots.append(root)
anyerrors = []
for pos, item in enumerate(vdoc):
sourceline = SourceLine(vdoc, pos, str)
success = False
for root in roots:
success = validate.validate_ex(
root,
item,
loader.identifiers,
strict,
foreign_properties=loader.foreign_properties,
raise_ex=False,
skip_foreign_properties=loader.skip_schemas,
strict_foreign_properties=strict_foreign_properties,
vocab=loader.vocab,
)
if success:
break
if not success:
errors: List[SchemaSaladException] = []
for root in roots:
if hasattr(root, "get_prop"):
name = root.get_prop("name")
elif hasattr(root, "name"):
name = root.name
try:
validate.validate_ex(
root,
item,
loader.identifiers,
strict,
foreign_properties=loader.foreign_properties,
raise_ex=True,
skip_foreign_properties=loader.skip_schemas,
strict_foreign_properties=strict_foreign_properties,
vocab=loader.vocab,
)
except ClassValidationException as exc1:
errors = [
ClassValidationException(
f"tried {validate.friendly(name)!r} but", sourceline, [exc1]
)
]
break
except ValidationException as exc2:
errors.append(
ValidationException(
f"tried {validate.friendly(name)!r} but", sourceline, [exc2]
)
)
objerr = "Invalid"
for ident in loader.identifiers:
if ident in item:
objerr = f"Object {relname(item[ident])!r} is not valid because"
break
anyerrors.append(ValidationException(objerr, sourceline, errors, "-"))
if anyerrors:
raise ValidationException("", None, anyerrors, "*")
def get_anon_name(rec: MutableMapping[str, Union[str, Dict[str, str], List[str]]]) -> str:
"""Calculate a reproducible name for anonymous types."""
if "name" in rec:
name = rec["name"]
if isinstance(name, str):
return name
raise ValidationException(f"Expected name field to be a string, was {name}")
anon_name = ""
if rec["type"] in ("enum", saladp + "enum"):
for sym in rec["symbols"]:
anon_name += sym
return "anon.enum_" + hashlib.sha1(anon_name.encode("UTF-8")).hexdigest() # nosec
if rec["type"] in ("record", saladp + "record"):
for field in rec["fields"]:
if isinstance(field, Mapping):
anon_name += field["name"]
else:
raise ValidationException(
f"Expected entries in 'fields' to also be maps, was {field}."
)
return "record_" + hashlib.sha1(anon_name.encode("UTF-8")).hexdigest() # nosec
if rec["type"] in ("array", saladp + "array"):
return ""
raise ValidationException("Expected enum or record, was {rec['type'])}")
def replace_type(
items: Any,
spec: Dict[str, Any],
loader: Loader,
found: Set[str],
find_embeds: bool = True,
deepen: bool = True,
) -> Any:
"""Go through and replace types in the 'spec' mapping."""
if isinstance(items, MutableMapping):
# recursively check these fields for types to replace
if items.get("type") in ("record", "enum") and items.get("name"):
if items["name"] in found:
return items["name"]
found.add(items["name"])
if not deepen:
return items
items = copy.copy(items)
if not items.get("name"):
items["name"] = get_anon_name(items)
for name in ("type", "items", "fields"):
if name in items:
items[name] = replace_type(
items[name],
spec,
loader,
found,
find_embeds=find_embeds,
deepen=find_embeds,
)
if isinstance(items[name], MutableSequence):
items[name] = flatten(items[name])
return items
if isinstance(items, MutableSequence):
# recursively transform list
return [
replace_type(i, spec, loader, found, find_embeds=find_embeds, deepen=deepen)
for i in items
]
if isinstance(items, str):
# found a string which is a symbol corresponding to a type.
replace_with = None
if items in loader.vocab:
# If it's a vocabulary term, first expand it to its fully qualified
# URI
items = loader.vocab[items]
if items in spec:
# Look up in specialization map
replace_with = spec[items]
if replace_with:
return replace_type(replace_with, spec, loader, found, find_embeds=find_embeds)
found.add(items)
return items
def avro_field_name(url: str) -> str:
"""
Turn a URL into an Avro-safe name.
If the URL has no fragment, return this plain URL.
Extract either the last part of the URL fragment past the slash, otherwise
the whole fragment.
"""
d = urlparse(url)
if d.fragment:
return d.fragment.split("/")[-1]
return d.path.split("/")[-1]
Avro = TypeVar("Avro", MutableMapping[str, Any], MutableSequence[Any], str)
def make_valid_avro(
items: Avro,
alltypes: Dict[str, Dict[str, Any]],
found: Set[str],
union: bool = False,
fielddef: bool = False,
vocab: Optional[Dict[str, str]] = None,
) -> Union[Avro, MutableMapping[str, str], str, List[Union[Any, MutableMapping[str, str], str]]]:
"""Convert our schema to be more avro like."""
if vocab is None:
_, _, metaschema_loader = get_metaschema()
vocab = metaschema_loader.vocab
# Possibly could be integrated into our fork of avro/schema.py?
if isinstance(items, MutableMapping):
avro = copy.copy(items)
if avro.get("name"):
if fielddef:
avro["name"] = avro_field_name(avro["name"])
else:
avro["name"] = validate.avro_type_name(avro["name"])
if "type" in avro and avro["type"] in (
saladp + "record",
saladp + "enum",
"record",
"enum",
):
if (hasattr(avro, "get") and avro.get("abstract")) or ("abstract" in avro):
return avro
if avro["name"] in found:
return cast(str, avro["name"])
found.add(avro["name"])
for field in ("type", "items", "values", "fields"):
if field in avro:
avro[field] = make_valid_avro(
avro[field],
alltypes,
found,
union=True,
fielddef=(field == "fields"),
vocab=vocab,
)
if "symbols" in avro:
avro["symbols"] = [avro_field_name(sym) for sym in avro["symbols"]]
return avro
if items and isinstance(items, MutableSequence):
ret = []
for i in items:
ret.append(
make_valid_avro(i, alltypes, found, union=union, fielddef=fielddef, vocab=vocab)
)
return ret
if union and isinstance(items, str):
if items in alltypes and validate.avro_type_name(items) not in found:
return make_valid_avro(alltypes[items], alltypes, found, union=union, vocab=vocab)
if items in vocab:
return validate.avro_type_name(vocab[items])
return validate.avro_type_name(items)
return items
def deepcopy_strip(item: Any) -> Any:
"""
Make a deep copy of list and dict objects.
Intentionally do not copy attributes. This is to discard CommentedMap and
CommentedSeq metadata which is very expensive with regular copy.deepcopy.
"""
if isinstance(item, MutableMapping):
return {k: deepcopy_strip(v) for k, v in item.items()}
if isinstance(item, MutableSequence):
return [deepcopy_strip(k) for k in item]
return item
def extend_and_specialize(items: List[Dict[str, Any]], loader: Loader) -> List[Dict[str, Any]]:
"""Apply 'extend' and 'specialize' to fully materialize derived record types."""
items2 = deepcopy_strip(items)
types = {i["name"]: i for i in items2} # type: Dict[str, Any]
results = []
for stype in items2:
if "extends" in stype:
specs = {} # type: Dict[str, str]
if "specialize" in stype:
for spec in aslist(stype["specialize"]):
specs[spec["specializeFrom"]] = spec["specializeTo"]
exfields = [] # type: List[Any]
exsym = [] # type: List[str]
for ex in aslist(stype["extends"]):
if ex not in types:
raise ValidationException(
f"Extends {stype['extends']} in {stype['name']} refers to invalid base type."
)
basetype = copy.copy(types[ex])
if stype["type"] == "record":
if specs:
basetype["fields"] = replace_type(
basetype.get("fields", []), specs, loader, set()
)
for field in basetype.get("fields", []):
if "inherited_from" not in field:
field["inherited_from"] = ex
exfields.extend(basetype.get("fields", []))
elif stype["type"] == "enum":
exsym.extend(basetype.get("symbols", []))
if stype["type"] == "record":
stype = copy.copy(stype)
combined_fields = []
fields = stype.get("fields", [])
# We use short names here so that if a type inherits a field
# (e.g. Child#id) from a parent (Parent#id) we avoid adding
# the same field twice (previously we had just
# ``exfields.extends(stype.fields)``).
sns_fields = {shortname(field["name"]): field for field in fields}
sns_exfields = {shortname(exfield["name"]): exfield for exfield in exfields}
# N.B.: This could be simpler. We could have a single loop
# to create the list of fields. The reason for this more
# convoluted solution is to make sure we keep the order
# of ``exfields`` first, and then the type fields. That's
# because we have unit tests that rely on the order that
# fields are written. Codegen output changes as well.
# We are relying on the insertion order preserving
# property of python dicts (i.e. relyig on Py3.5+).
# First pass adding the exfields.
for sn_exfield, exfield in sns_exfields.items():
field = sns_fields.get(sn_exfield, None)
if field is None:
field = exfield
else:
# make sure field name has not been used yet
if not is_subtype(exfield["type"], field["type"]):
raise SchemaParseException(
f"Field name {field['name']} already in use with "
"incompatible type. "
f"{field['type']} vs {exfield['type']}."
)
combined_fields.append(field)
# Second pass, now add the ones that are specific to the subtype.
for field in sns_fields.values():
if field not in combined_fields:
combined_fields.append(field)
stype["fields"] = combined_fields
fieldnames = set() # type: Set[str]
for field in stype["fields"]:
if field["name"] in fieldnames:
raise ValidationException(
f"Field name {field['name']} appears twice in {stype['name']}"
)
fieldnames.add(field["name"])
elif stype["type"] == "enum":
stype = copy.copy(stype)
exsym.extend(stype.get("symbols", []))
stype["symbols"] = exsym
types[stype["name"]] = stype
results.append(stype)
ex_types = {}
for result in results:
ex_types[result["name"]] = result
extended_by = {} # type: Dict[str, str]
for result in results:
if "extends" in result:
for ex in aslist(result["extends"]):
if ex_types[ex].get("abstract"):
add_dictlist(extended_by, ex, ex_types[result["name"]])
add_dictlist(extended_by, validate.avro_type_name(ex), ex_types[ex])
for result in results:
if result.get("abstract") and result["name"] not in extended_by:
raise ValidationException(
f"{result['name']} is abstract but missing a concrete subtype"
)
for result in results:
if "fields" in result:
result["fields"] = replace_type(result["fields"], extended_by, loader, set())
return results
def make_avro(
i: List[Dict[str, Any]],
loader: Loader,
metaschema_vocab: Optional[Dict[str, str]] = None,
) -> List[Any]:
j = extend_and_specialize(i, loader)
name_dict = {} # type: Dict[str, Dict[str, Any]]
for entry in j:
name_dict[entry["name"]] = entry
avro = make_valid_avro(j, name_dict, set(), vocab=metaschema_vocab)
return [
t
for t in avro
if isinstance(t, MutableMapping)
and not t.get("abstract")
and t.get("type") != "org.w3id.cwl.salad.documentation"
]
def make_avro_schema(
i: List[Any], loader: Loader, metaschema_vocab: Optional[Dict[str, str]] = None
) -> Names:
"""
All in one convenience function.
Call make_avro() and make_avro_schema_from_avro() separately if you need
the intermediate result for diagnostic output.
"""
names = Names()
avro = make_avro(i, loader, metaschema_vocab)
make_avsc_object(convert_to_dict(avro), names)
return names
def make_avro_schema_from_avro(avro: List[Union[Avro, Dict[str, str], str]]) -> Names:
names = Names()
make_avsc_object(convert_to_dict(avro), names)
return names
def shortname(inputid: str) -> str:
"""Return the last segment of the provided fragment or path."""
parsed_id = urlparse(inputid)
if parsed_id.fragment:
return parsed_id.fragment.split("/")[-1]
return parsed_id.path.split("/")[-1]
def print_inheritance(doc: List[Dict[str, Any]], stream: IO[Any]) -> None:
"""Write a Grapviz inheritance graph for the supplied document."""
stream.write("digraph {\n")
for entry in doc:
if entry["type"] == "record":
label = name = shortname(entry["name"])
fields = entry.get("fields", [])
if fields:
label += "\\n* {}\\l".format(
"\\l* ".join(shortname(field["name"]) for field in fields)
)
shape = "ellipse" if entry.get("abstract") else "box"
stream.write(f'"{name}" [shape={shape} label="{label}"];\n') # noqa: B907
if "extends" in entry:
for target in aslist(entry["extends"]):
stream.write(f'"{shortname(target)}" -> "{name}";\n') # noqa: B907
stream.write("}\n")
def print_fieldrefs(doc: List[Dict[str, Any]], loader: Loader, stream: IO[Any]) -> None:
"""Write a GraphViz graph of the relationships between the fields."""
obj = extend_and_specialize(doc, loader)
primitives = {
"http://www.w3.org/2001/XMLSchema#string",
"http://www.w3.org/2001/XMLSchema#boolean",
"http://www.w3.org/2001/XMLSchema#int",
"http://www.w3.org/2001/XMLSchema#long",
saladp + "null",
saladp + "enum",
saladp + "array",
saladp + "record",
saladp + "Any",
}
stream.write("digraph {\n")
for entry in obj:
if entry.get("abstract"):
continue
if entry["type"] == "record":
label = shortname(entry["name"])
for field in entry.get("fields", []):
found = set() # type: Set[str]
field_name = shortname(field["name"])
replace_type(field["type"], {}, loader, found, find_embeds=False)
for each_type in found:
if each_type not in primitives:
stream.write(
f"{label!r} -> {shortname(each_type)!r} [label={field_name!r}];\n"
)
stream.write("}\n")
|
/schema-salad-8.4.20230808163024.tar.gz/schema-salad-8.4.20230808163024/schema_salad/schema.py
| 0.627609 | 0.255406 |
schema.py
|
pypi
|
import logging
import pprint
from typing import Any, List, Mapping, MutableMapping, MutableSequence, Optional, Set
from urllib.parse import urlsplit
from . import avro
from .avro.schema import Schema
from .exceptions import (
ClassValidationException,
SchemaSaladException,
ValidationException,
)
from .sourceline import SourceLine
_logger = logging.getLogger("salad")
def validate(
expected_schema: Schema,
datum: Any,
identifiers: Optional[List[str]] = None,
strict: bool = False,
foreign_properties: Optional[Set[str]] = None,
vocab: Optional[Mapping[str, str]] = None,
) -> bool:
if not identifiers:
identifiers = []
if not foreign_properties:
foreign_properties = set()
return validate_ex(
expected_schema,
datum,
identifiers,
strict=strict,
foreign_properties=foreign_properties,
raise_ex=False,
vocab=vocab,
)
INT_MIN_VALUE = -(1 << 31)
INT_MAX_VALUE = (1 << 31) - 1
LONG_MIN_VALUE = -(1 << 63)
LONG_MAX_VALUE = (1 << 63) - 1
def avro_shortname(name: str) -> str:
"""Produce an avro friendly short name."""
return name.split(".")[-1]
saladp = "https://w3id.org/cwl/salad#"
primitives = {
"http://www.w3.org/2001/XMLSchema#string": "string",
"http://www.w3.org/2001/XMLSchema#boolean": "boolean",
"http://www.w3.org/2001/XMLSchema#int": "int",
"http://www.w3.org/2001/XMLSchema#long": "long",
"http://www.w3.org/2001/XMLSchema#float": "float",
"http://www.w3.org/2001/XMLSchema#double": "double",
saladp + "null": "null",
saladp + "enum": "enum",
saladp + "array": "array",
saladp + "record": "record",
}
def avro_type_name(url: str) -> str:
"""
Turn a URL into an Avro-safe name.
If the URL has no fragment, return this plain URL.
Extract either the last part of the URL fragment past the slash, otherwise
the whole fragment.
"""
global primitives
if url in primitives:
return primitives[url]
u = urlsplit(url)
joined = filter(
lambda x: x,
list(reversed(u.netloc.split("."))) + u.path.split("/") + u.fragment.split("/"),
)
return ".".join(joined)
def friendly(v): # type: (Any) -> Any
if isinstance(v, avro.schema.NamedSchema):
return avro_shortname(v.name)
if isinstance(v, avro.schema.ArraySchema):
return f"array of <{friendly(v.items)}>"
if isinstance(v, avro.schema.PrimitiveSchema):
return v.type
if isinstance(v, avro.schema.UnionSchema):
return " or ".join([friendly(s) for s in v.schemas])
return avro_shortname(v)
def vpformat(datum): # type: (Any) -> str
a = pprint.pformat(datum)
if len(a) > 160:
a = a[0:160] + "[...]"
return a
def validate_ex(
expected_schema: Schema,
datum, # type: Any
identifiers=None, # type: Optional[List[str]]
strict=False, # type: bool
foreign_properties=None, # type: Optional[Set[str]]
raise_ex=True, # type: bool
strict_foreign_properties=False, # type: bool
logger=_logger, # type: logging.Logger
skip_foreign_properties=False, # type: bool
vocab=None, # type: Optional[Mapping[str, str]]
):
# type: (...) -> bool
"""Determine if a python datum is an instance of a schema."""
debug = _logger.isEnabledFor(logging.DEBUG)
if not identifiers:
identifiers = []
if not foreign_properties:
foreign_properties = set()
if vocab is None:
raise Exception("vocab must be provided")
schema_type = expected_schema.type
if schema_type == "null":
if datum is None:
return True
if raise_ex:
raise ValidationException("the value is not null")
return False
if schema_type == "boolean":
if isinstance(datum, bool):
return True
if raise_ex:
raise ValidationException("the value is not boolean")
return False
if schema_type == "string":
if isinstance(datum, str):
return True
if isinstance(datum, bytes):
return True
if raise_ex:
raise ValidationException("the value is not string")
return False
if schema_type == "int":
if isinstance(datum, int) and INT_MIN_VALUE <= datum <= INT_MAX_VALUE:
return True
if raise_ex:
raise ValidationException(f"{vpformat(datum)!r} is not int")
return False
if schema_type == "long":
if (isinstance(datum, int)) and LONG_MIN_VALUE <= datum <= LONG_MAX_VALUE:
return True
if raise_ex:
raise ValidationException(f"the value {vpformat(datum)!r} is not long")
return False
if schema_type in ["float", "double"]:
if isinstance(datum, (int, float)):
return True
if raise_ex:
raise ValidationException(f"the value {vpformat(datum)!r} is not float or double")
return False
if isinstance(expected_schema, avro.schema.EnumSchema):
if expected_schema.name in ("org.w3id.cwl.salad.Any", "Any"):
if datum is not None:
return True
if raise_ex:
raise ValidationException("'Any' type must be non-null")
return False
if not isinstance(datum, str):
if raise_ex:
raise ValidationException(
f"value is a {type(datum).__name__} but expected a string"
)
return False
if expected_schema.name == "org.w3id.cwl.cwl.Expression":
if "$(" in datum or "${" in datum:
return True
if raise_ex:
raise ValidationException(
f"value {datum!r} does not contain an expression in the form $() or ${{}}"
)
return False
if datum in expected_schema.symbols:
return True
if raise_ex:
raise ValidationException(
"the value {} is not a valid {}, expected {}{}".format(
vpformat(datum),
friendly(expected_schema.name),
"one of " if len(expected_schema.symbols) > 1 else "",
"'" + "', '".join(expected_schema.symbols) + "'",
)
)
return False
if isinstance(expected_schema, avro.schema.ArraySchema):
if isinstance(datum, MutableSequence):
for i, d in enumerate(datum):
try:
sl = SourceLine(datum, i, ValidationException)
if not validate_ex(
expected_schema.items,
d,
identifiers,
strict=strict,
foreign_properties=foreign_properties,
raise_ex=raise_ex,
strict_foreign_properties=strict_foreign_properties,
logger=logger,
skip_foreign_properties=skip_foreign_properties,
vocab=vocab,
):
return False
except ValidationException as v:
if raise_ex:
source = v if debug else None
raise ValidationException("item is invalid because", sl, [v]) from source
return False
return True
if raise_ex:
raise ValidationException(
f"the value {vpformat(datum)} is not a list, "
f"expected list of {friendly(expected_schema.items)}"
)
return False
if isinstance(expected_schema, avro.schema.UnionSchema):
for s in expected_schema.schemas:
if validate_ex(
s,
datum,
identifiers,
strict=strict,
raise_ex=False,
strict_foreign_properties=strict_foreign_properties,
logger=logger,
skip_foreign_properties=skip_foreign_properties,
vocab=vocab,
):
return True
if not raise_ex:
return False
errors: List[SchemaSaladException] = []
checked = []
for s in expected_schema.schemas:
if isinstance(datum, MutableSequence) and not isinstance(s, avro.schema.ArraySchema):
continue
if isinstance(datum, MutableMapping) and not isinstance(s, avro.schema.RecordSchema):
continue
if isinstance(datum, (bool, int, float, str)) and isinstance(
s, (avro.schema.ArraySchema, avro.schema.RecordSchema)
):
continue
if datum is not None and s.type == "null":
continue
checked.append(s)
try:
validate_ex(
s,
datum,
identifiers,
strict=strict,
foreign_properties=foreign_properties,
raise_ex=True,
strict_foreign_properties=strict_foreign_properties,
logger=logger,
skip_foreign_properties=skip_foreign_properties,
vocab=vocab,
)
except ClassValidationException:
raise
except ValidationException as e:
errors.append(e)
if bool(errors):
raise ValidationException(
"",
None,
[
ValidationException(f"tried {friendly(check)} but", None, [err])
for (check, err) in zip(checked, errors)
],
"-",
)
raise ValidationException(
f"value is a {type(datum).__name__}, expected {friendly(expected_schema)}"
)
if isinstance(expected_schema, avro.schema.RecordSchema):
if not isinstance(datum, MutableMapping):
if raise_ex:
raise ValidationException(
f"is not a dict. Expected a {friendly(expected_schema.name)} object."
)
return False
classmatch = None
for f in expected_schema.fields:
if f.name in ("class",):
d = datum.get(f.name)
if not d:
if raise_ex:
raise ValidationException(f"Missing {f.name!r} field")
return False
avroname = None
if d in vocab:
avroname = avro_type_name(vocab[d])
if expected_schema.name not in (d, avroname):
if raise_ex:
raise ValidationException(
f"Expected class {expected_schema.name!r} but this is {d!r}"
)
return False
classmatch = d
break
errors = []
for f in expected_schema.fields:
if f.name in ("class",):
continue
if f.name in datum:
fieldval = datum[f.name]
else:
try:
fieldval = f.default
except KeyError:
fieldval = None
try:
sl = SourceLine(datum, f.name, str)
if not validate_ex(
f.type,
fieldval,
identifiers,
strict=strict,
foreign_properties=foreign_properties,
raise_ex=raise_ex,
strict_foreign_properties=strict_foreign_properties,
logger=logger,
skip_foreign_properties=skip_foreign_properties,
vocab=vocab,
):
return False
except ValidationException as v:
if f.name not in datum:
errors.append(ValidationException(f"missing required field {f.name!r}"))
else:
errors.append(
ValidationException(
f"the {f.name!r} field is not valid because",
sl,
[v],
)
)
for d in datum:
found = False
for f in expected_schema.fields:
if d == f.name:
found = True
if not found:
sl = SourceLine(datum, d, str)
if d is None:
err = ValidationException("mapping with implicit null key", sl)
if strict:
errors.append(err)
else:
logger.warning(err.as_warning())
continue
if d not in identifiers and d not in foreign_properties and d[0] not in ("@", "$"):
if (
(d not in identifiers and strict)
and (
d not in foreign_properties
and strict_foreign_properties
and not skip_foreign_properties
)
and not raise_ex
):
return False
split = urlsplit(d)
if split.scheme:
if not skip_foreign_properties:
err = ValidationException(
"unrecognized extension field {!r}{}.{}".format(
d,
" and strict_foreign_properties checking is enabled"
if strict_foreign_properties
else "",
"\nForeign properties from $schemas:\n {}".format(
"\n ".join(sorted(foreign_properties))
)
if len(foreign_properties) > 0
else "",
),
sl,
)
if strict_foreign_properties:
errors.append(err)
elif len(foreign_properties) > 0:
logger.warning(err.as_warning())
else:
err = ValidationException(
"invalid field {!r}, expected one of: {}".format(
d,
", ".join(f"{fn.name!r}" for fn in expected_schema.fields),
),
sl,
)
if strict:
errors.append(err)
else:
logger.warning(err.as_warning())
if bool(errors):
if raise_ex:
if classmatch:
raise ClassValidationException("", None, errors, "*")
raise ValidationException("", None, errors, "*")
return False
return True
if raise_ex:
raise ValidationException(f"Unrecognized schema_type {schema_type}")
return False
|
/schema-salad-8.4.20230808163024.tar.gz/schema-salad-8.4.20230808163024/schema_salad/validate.py
| 0.73431 | 0.211906 |
validate.py
|
pypi
|
import json
import os
import sys
from io import BufferedWriter
from typing import (
IO,
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterable,
Mapping,
MutableSequence,
Optional,
Tuple,
TypeVar,
Union,
)
import requests
from rdflib.graph import Graph
from ruamel.yaml.comments import CommentedMap, CommentedSeq
from ruamel.yaml.constructor import RoundTripConstructor
from ruamel.yaml.main import YAML
if TYPE_CHECKING:
from .fetcher import Fetcher
ContextType = Dict[str, Union[Dict[str, Any], str, Iterable[str]]]
DocumentType = TypeVar("DocumentType", CommentedSeq, CommentedMap)
DocumentOrStrType = TypeVar("DocumentOrStrType", CommentedSeq, CommentedMap, str)
FieldType = TypeVar("FieldType", str, CommentedSeq, CommentedMap)
MandatoryResolveType = Union[int, float, str, CommentedMap, CommentedSeq]
ResolveType = Optional[MandatoryResolveType]
ResolvedRefType = Tuple[ResolveType, CommentedMap]
IdxResultType = Union[CommentedMap, CommentedSeq, str, None]
IdxType = Dict[str, IdxResultType]
CacheType = Dict[str, Union[str, Graph, bool]]
FetcherCallableType = Callable[[CacheType, requests.sessions.Session], "Fetcher"]
AttachmentsType = Callable[[Union[CommentedMap, CommentedSeq]], bool]
def add_dictlist(di, key, val): # type: (Dict[Any, Any], Any, Any) -> None
if key not in di:
di[key] = []
di[key].append(val)
def aslist(thing: Any) -> MutableSequence[Any]:
"""
Wrap single items and lists.
Return lists unchanged.
"""
if isinstance(thing, MutableSequence):
return thing
return [thing]
def flatten(thing, ltypes=(list, tuple)):
# type: (Any, Any) -> Any
# http://rightfootin.blogspot.com/2006/09/more-on-python-flatten.html
if thing is None:
return []
if not isinstance(thing, ltypes):
return [thing]
ltype = type(thing)
lst = list(thing)
i = 0
while i < len(lst):
while isinstance(lst[i], ltypes):
if not lst[i]:
lst.pop(i)
i -= 1
break
lst[i : i + 1] = lst[i]
i += 1
return ltype(lst)
# Check if we are on windows OS
def onWindows():
# type: () -> (bool)
return os.name == "nt"
def convert_to_dict(j4): # type: (Any) -> Any
if isinstance(j4, Mapping):
return {k: convert_to_dict(v) for k, v in j4.items()}
if isinstance(j4, MutableSequence):
return [convert_to_dict(v) for v in j4]
return j4
def json_dump(obj: Any, fp: IO[str], **kwargs: Any) -> None:
"""Force use of unicode."""
json.dump(convert_to_dict(obj), fp, **kwargs)
def json_dumps(
obj, # type: Any
**kwargs, # type: Any
): # type: (...) -> str
"""Force use of unicode."""
return json.dumps(convert_to_dict(obj), **kwargs)
def stdout() -> BufferedWriter:
"""Build a replacement for sys.stdout that allow for writing binary data."""
return os.fdopen(sys.stdout.fileno(), "wb", closefd=False)
class _RoundTripNoTimeStampConstructor(RoundTripConstructor):
def construct_yaml_timestamp(self: Any, node: Any, values: Any = None) -> Any:
return node.value
_RoundTripNoTimeStampConstructor.add_constructor(
"tag:yaml.org,2002:timestamp",
_RoundTripNoTimeStampConstructor.construct_yaml_timestamp,
)
# mypy: no-warn-unused-ignores
def yaml_no_ts() -> YAML:
"""
Get a YAML loader that won't parse timestamps into datetime objects.
Such datetime objects can't be easily dumped into JSON.
"""
yaml = YAML(typ="rt")
yaml.preserve_quotes = True # type: ignore
yaml.Constructor = _RoundTripNoTimeStampConstructor
return yaml
|
/schema-salad-8.4.20230808163024.tar.gz/schema-salad-8.4.20230808163024/schema_salad/utils.py
| 0.544075 | 0.217244 |
utils.py
|
pypi
|
import re
from typing import IO, Any, Dict, List, Optional, Tuple, Union, cast
from . import _logger
from .codegen_base import CodeGenBase, TypeDef
from .exceptions import SchemaException
from .schema import shortname
from .utils import aslist
def replaceKeywords(s: str) -> str:
"""Rename keywords that are reserved in C++."""
if s in (
"class",
"enum",
"int",
"long",
"float",
"double",
"default",
"stdin",
"stdout",
"stderr",
):
s = s + "_"
return s
def safename(name: str) -> str:
"""Create a C++ safe name."""
classname = re.sub("[^a-zA-Z0-9]", "_", name)
return replaceKeywords(classname)
# TODO: this should be somehow not really exists
def safename2(name: Dict[str, str]) -> str:
"""Create a namespaced safename."""
return safename(name["namespace"]) + "::" + safename(name["classname"])
# Splits names like https://xyz.xyz/blub#cwl/class
# into its class path and non class path
def split_name(s: str) -> Tuple[str, str]:
t = s.split("#")
if len(t) != 2:
raise ValueError("Expected field to be formatted as 'https://xyz.xyz/blub#cwl/class'.")
return (t[0], t[1])
# similar to split_name but for field names
def split_field(s: str) -> Tuple[str, str, str]:
(namespace, field) = split_name(s)
t = field.split("/")
if len(t) != 2:
raise ValueError("Expected field to be formatted as 'https://xyz.xyz/blub#cwl/class'.")
return (namespace, t[0], t[1])
# Prototype of a class
class ClassDefinition:
def __init__(self, name: str):
self.fullName = name
self.extends: List[Dict[str, str]] = []
self.fields: List[FieldDefinition] = []
self.abstract = False
(self.namespace, self.classname) = split_name(name)
self.namespace = safename(self.namespace)
self.classname = safename(self.classname)
def writeFwdDeclaration(self, target: IO[str], fullInd: str, ind: str) -> None:
target.write(f"{fullInd}namespace {self.namespace} {{ struct {self.classname}; }}\n")
def writeDefinition(self, target: IO[Any], fullInd: str, ind: str) -> None:
target.write(f"{fullInd}namespace {self.namespace} {{\n")
target.write(f"{fullInd}struct {self.classname}")
extends = list(map(safename2, self.extends))
override = ""
virtual = "virtual "
if len(self.extends) > 0:
target.write(f"\n{fullInd}{ind}: ")
target.write(f"\n{fullInd}{ind}, ".join(extends))
override = " override"
virtual = ""
target.write(" {\n")
for field in self.fields:
field.writeDefinition(target, fullInd + ind, ind, self.namespace)
if self.abstract:
target.write(f"{fullInd}{ind}virtual ~{self.classname}() = 0;\n")
target.write(f"{fullInd}{ind}{virtual}auto toYaml() const -> YAML::Node{override};\n")
target.write(f"{fullInd}}};\n")
target.write(f"{fullInd}}}\n\n")
def writeImplDefinition(self, target: IO[str], fullInd: str, ind: str) -> None:
extends = list(map(safename2, self.extends))
if self.abstract:
target.write(
f"{fullInd}inline {self.namespace}::{self.classname}::~{self.classname}() = default;\n"
)
target.write(
f"""{fullInd}inline auto {self.namespace}::{self.classname}::toYaml() const -> YAML::Node {{
{fullInd}{ind}using ::toYaml;
{fullInd}{ind}auto n = YAML::Node{{}};
"""
)
for e in extends:
target.write(f"{fullInd}{ind}n = mergeYaml(n, {e}::toYaml());\n")
for field in self.fields:
fieldname = safename(field.name)
target.write(
f'{fullInd}{ind}addYamlField(n, "{field.name}", toYaml(*{fieldname}));\n' # noqa: B907
)
# target.write(f"{fullInd}{ind}addYamlIfNotEmpty(n, \"{field.name}\", toYaml(*{fieldname}));\n")
target.write(f"{fullInd}{ind}return n;\n{fullInd}}}\n")
# Prototype of a single field of a class
class FieldDefinition:
def __init__(self, name: str, typeStr: str, optional: bool):
self.name = name
self.typeStr = typeStr
self.optional = optional
def writeDefinition(self, target: IO[Any], fullInd: str, ind: str, namespace: str) -> None:
"""Write a C++ definition for the class field."""
name = safename(self.name)
typeStr = self.typeStr.replace(namespace + "::", "")
target.write(f"{fullInd}heap_object<{typeStr}> {name};\n")
# Prototype of an enum definition
class EnumDefinition:
def __init__(self, name: str, values: List[str]):
self.name = name
self.values = values
def writeDefinition(self, target: IO[str], ind: str) -> None:
namespace = ""
if len(self.name.split("#")) == 2:
(namespace, classname) = split_name(self.name)
namespace = safename(namespace)
classname = safename(classname)
name = namespace + "::" + classname
else:
name = safename(self.name)
classname = name
if len(namespace) > 0:
target.write(f"namespace {namespace} {{\n")
target.write(f"enum class {classname} : unsigned int {{\n{ind}")
target.write(f",\n{ind}".join(map(safename, self.values)))
target.write("\n};\n")
target.write(f"inline auto to_string({classname} v) {{\n")
target.write(f"{ind}static auto m = std::vector<std::string_view> {{\n")
target.write(f'{ind} "')
target.write(f'",\n{ind} "'.join(self.values))
target.write(f'"\n{ind}}};\n')
target.write(f"{ind}using U = std::underlying_type_t<{name}>;\n")
target.write(f"{ind}return m.at(static_cast<U>(v));\n}}\n")
if len(namespace) > 0:
target.write("}\n")
target.write(f"inline void to_enum(std::string_view v, {name}& out) {{\n")
target.write(f"{ind}static auto m = std::map<std::string, {name}, std::less<>> {{\n")
for v in self.values:
target.write(f'{ind}{ind}{{"{v}", {name}::{safename(v)}}},\n') # noqa: B907
target.write(f"{ind}}};\n{ind}out = m.find(v)->second;\n}}\n")
target.write(f"inline auto toYaml({name} v) {{\n")
target.write(f"{ind}return YAML::Node{{std::string{{to_string(v)}}}};\n}}\n")
target.write(f"inline auto yamlToEnum(YAML::Node n, {name}& out) {{\n")
target.write(f"{ind}to_enum(n.as<std::string>(), out);\n}}\n")
# !TODO way tot many functions, most of these shouldn't exists
def isPrimitiveType(v: Any) -> bool:
if not isinstance(v, str):
return False
return v in ["null", "boolean", "int", "long", "float", "double", "string"]
def hasFieldValue(e: Any, f: str, v: Any) -> bool:
if not isinstance(e, dict):
return False
if f not in e:
return False
return bool(e[f] == v)
def isRecordSchema(v: Any) -> bool:
return hasFieldValue(v, "type", "record")
def isEnumSchema(v: Any) -> bool:
if not hasFieldValue(v, "type", "enum"):
return False
if "symbols" not in v:
return False
if not isinstance(v["symbols"], list):
return False
return True
def isArray(v: Any) -> bool:
if not isinstance(v, list):
return False
for i in v:
if not pred(i):
return False
return True
def pred(i: Any) -> bool:
return (
isPrimitiveType(i)
or isRecordSchema(i)
or isEnumSchema(i)
or isArraySchema(i)
or isinstance(i, str)
)
def isArraySchema(v: Any) -> bool:
if not hasFieldValue(v, "type", "array"):
return False
if "items" not in v:
return False
if not isinstance(v["items"], list):
return False
for i in v["items"]:
if not (pred(i) or isArray(i)):
return False
return True
class CppCodeGen(CodeGenBase):
"""Generation of C++ code for a given Schema Salad definition."""
def __init__(
self,
base: str,
target: IO[str],
examples: Optional[str],
package: str,
copyright: Optional[str],
) -> None:
super().__init__()
self.base_uri = base
self.target = target
self.examples = examples
self.package = package
self.copyright = copyright
self.classDefinitions: Dict[str, ClassDefinition] = {}
self.enumDefinitions: Dict[str, EnumDefinition] = {}
def convertTypeToCpp(self, type_declaration: Union[List[Any], Dict[str, Any], str]) -> str:
"""Convert a Schema Salad type to a C++ type."""
if not isinstance(type_declaration, list):
return self.convertTypeToCpp([type_declaration])
if len(type_declaration) == 1:
if type_declaration[0] in ("null", "https://w3id.org/cwl/salad#null"):
return "std::monostate"
elif type_declaration[0] in (
"string",
"http://www.w3.org/2001/XMLSchema#string",
):
return "std::string"
elif type_declaration[0] in ("int", "http://www.w3.org/2001/XMLSchema#int"):
return "int32_t"
elif type_declaration[0] in (
"long",
"http://www.w3.org/2001/XMLSchema#long",
):
return "int64_t"
elif type_declaration[0] in (
"float",
"http://www.w3.org/2001/XMLSchema#float",
):
return "float"
elif type_declaration[0] in (
"double",
"http://www.w3.org/2001/XMLSchema#double",
):
return "double"
elif type_declaration[0] in (
"boolean",
"http://www.w3.org/2001/XMLSchema#boolean",
):
return "bool"
elif type_declaration[0] == "https://w3id.org/cwl/salad#Any":
return "std::any"
elif type_declaration[0] in (
"PrimitiveType",
"https://w3id.org/cwl/salad#PrimitiveType",
):
return "std::variant<bool, int32_t, int64_t, float, double, std::string>"
elif isinstance(type_declaration[0], dict):
if "type" in type_declaration[0] and type_declaration[0]["type"] in (
"enum",
"https://w3id.org/cwl/salad#enum",
):
name = type_declaration[0]["name"]
if name not in self.enumDefinitions:
self.enumDefinitions[name] = EnumDefinition(
type_declaration[0]["name"],
list(map(shortname, type_declaration[0]["symbols"])),
)
if len(name.split("#")) != 2:
return safename(name)
(namespace, classname) = name.split("#")
return safename(namespace) + "::" + safename(classname)
elif "type" in type_declaration[0] and type_declaration[0]["type"] in (
"array",
"https://w3id.org/cwl/salad#array",
):
items = type_declaration[0]["items"]
if isinstance(items, list):
ts = []
for i in items:
ts.append(self.convertTypeToCpp(i))
name = ", ".join(ts)
return f"std::vector<std::variant<{name}>>"
else:
i = self.convertTypeToCpp(items)
return f"std::vector<{i}>"
elif "type" in type_declaration[0] and type_declaration[0]["type"] in (
"record",
"https://w3id.org/cwl/salad#record",
):
n = type_declaration[0]["name"]
(namespace, classname) = split_name(n)
return safename(namespace) + "::" + safename(classname)
n = type_declaration[0]["type"]
(namespace, classname) = split_name(n)
return safename(namespace) + "::" + safename(classname)
if len(type_declaration[0].split("#")) != 2:
_logger.debug(f"// something weird2 about {type_declaration[0]}")
return cast(str, type_declaration[0])
(namespace, classname) = split_name(type_declaration[0])
return safename(namespace) + "::" + safename(classname)
type_declaration = list(map(self.convertTypeToCpp, type_declaration))
type_declaration = ", ".join(type_declaration)
return f"std::variant<{type_declaration}>"
# start of our generated file
def epilogue(self, root_loader: Optional[TypeDef]) -> None:
self.target.write(
"""#pragma once
// Generated by schema-salad code generator
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <map>
#include <string>
#include <string_view>
#include <variant>
#include <vector>
#include <yaml-cpp/yaml.h>
#include <any>
inline auto mergeYaml(YAML::Node n1, YAML::Node n2) {
for (auto const& e : n1) {
n2[e.first.as<std::string>()] = e.second;
}
return n2;
}
// declaring toYaml
inline auto toYaml(bool v) {
return YAML::Node{v};
}
inline auto toYaml(float v) {
return YAML::Node{v};
}
inline auto toYaml(double v) {
return YAML::Node{v};
}
inline auto toYaml(int32_t v) {
return YAML::Node{v};
}
inline auto toYaml(int64_t v) {
return YAML::Node{v};
}
inline auto toYaml(std::any const&) {
return YAML::Node{};
}
inline auto toYaml(std::monostate const&) {
return YAML::Node(YAML::NodeType::Undefined);
}
inline auto toYaml(std::string const& v) {
return YAML::Node{v};
}
inline void addYamlField(YAML::Node node, std::string const& key, YAML::Node value) {
if (value.IsDefined()) {
node[key] = value;
}
}
// fwd declaring toYaml
template <typename T>
auto toYaml(std::vector<T> const& v) -> YAML::Node;
template <typename T>
auto toYaml(T const& t) -> YAML::Node;
template <typename ...Args>
auto toYaml(std::variant<Args...> const& t) -> YAML::Node;
template <typename T>
class heap_object {
std::unique_ptr<T> data = std::make_unique<T>();
public:
heap_object() = default;
heap_object(heap_object const& oth) {
*data = *oth;
}
heap_object(heap_object&& oth) {
*data = *oth;
}
template <typename T2>
heap_object(T2 const& oth) {
*data = oth;
}
template <typename T2>
heap_object(T2&& oth) {
*data = oth;
}
auto operator=(heap_object const& oth) -> heap_object& {
*data = *oth;
return *this;
}
auto operator=(heap_object&& oth) -> heap_object& {
*data = std::move(*oth);
return *this;
}
template <typename T2>
auto operator=(T2 const& oth) -> heap_object& {
*data = oth;
return *this;
}
template <typename T2>
auto operator=(T2&& oth) -> heap_object& {
*data = std::move(oth);
return *this;
}
auto operator->() -> T* {
return data.get();
}
auto operator->() const -> T const* {
return data.get();
}
auto operator*() -> T& {
return *data;
}
auto operator*() const -> T const& {
return *data;
}
};
"""
)
# main body, printing fwd declaration, class definitions, and then implementations
for key in self.classDefinitions:
self.classDefinitions[key].writeFwdDeclaration(self.target, "", " ")
for key in self.enumDefinitions:
self.enumDefinitions[key].writeDefinition(self.target, " ")
for key in self.classDefinitions:
self.classDefinitions[key].writeDefinition(self.target, "", " ")
for key in self.classDefinitions:
self.classDefinitions[key].writeImplDefinition(self.target, "", " ")
self.target.write(
"""
template <typename T>
auto toYaml(std::vector<T> const& v) -> YAML::Node {
auto n = YAML::Node(YAML::NodeType::Sequence);
for (auto const& e : v) {
n.push_back(toYaml(e));
}
return n;
}
template <typename T>
auto toYaml(T const& t) -> YAML::Node {
if constexpr (std::is_enum_v<T>) {
return toYaml(t);
} else {
return t.toYaml();
}
}
template <typename ...Args>
auto toYaml(std::variant<Args...> const& t) -> YAML::Node {
return std::visit([](auto const& e) {
return toYaml(e);
}, t);
}
"""
)
def parseRecordField(self, field: Dict[str, Any]) -> FieldDefinition:
(namespace, classname, fieldname) = split_field(field["name"])
if isinstance(field["type"], dict):
if field["type"]["type"] == "enum":
fieldtype = "Enum"
else:
fieldtype = self.convertTypeToCpp(field["type"])
else:
fieldtype = field["type"]
fieldtype = self.convertTypeToCpp(fieldtype)
return FieldDefinition(name=fieldname, typeStr=fieldtype, optional=False)
def parseRecordSchema(self, stype: Dict[str, Any]) -> None:
cd = ClassDefinition(name=stype["name"])
cd.abstract = stype.get("abstract", False)
if "extends" in stype:
for ex in aslist(stype["extends"]):
(base_namespace, base_classname) = split_name(ex)
ext = {"namespace": base_namespace, "classname": base_classname}
cd.extends.append(ext)
if "fields" in stype:
for field in stype["fields"]:
cd.fields.append(self.parseRecordField(field))
self.classDefinitions[stype["name"]] = cd
def parseEnum(self, stype: Dict[str, Any]) -> str:
name = cast(str, stype["name"])
if name not in self.enumDefinitions:
self.enumDefinitions[name] = EnumDefinition(
name, list(map(shortname, stype["symbols"]))
)
return name
def parse(self, items: List[Dict[str, Any]]) -> None:
for stype in items:
if "type" in stype and stype["type"] == "documentation":
continue
if not (pred(stype) or isArray(stype)):
raise SchemaException("not a valid SaladRecordField")
# parsing a record
if isRecordSchema(stype):
self.parseRecordSchema(stype)
elif isEnumSchema(stype):
self.parseEnum(stype)
else:
_logger.error(f"not parsed{stype}")
self.epilogue(None)
self.target.close()
|
/schema-salad-8.4.20230808163024.tar.gz/schema-salad-8.4.20230808163024/schema_salad/cpp_codegen.py
| 0.642432 | 0.216591 |
cpp_codegen.py
|
pypi
|
import os
import shutil
import string
from io import StringIO
from pathlib import Path
from typing import (
Any,
Dict,
List,
MutableMapping,
MutableSequence,
Optional,
Set,
Union,
)
from importlib_resources import files
from . import _logger, schema
from .codegen_base import CodeGenBase, TypeDef
from .exceptions import SchemaException
from .java_codegen import _ensure_directory_and_write, _safe_makedirs
from .schema import shortname
def doc_to_doc_string(doc: Optional[str], indent_level: int = 0) -> str:
"""Generate a documentation string from a schema salad doc field."""
lead = " " + " " * indent_level + "* "
if doc:
doc_str = "\n".join([f"{lead}{line}" for line in doc.split("\n")])
else:
doc_str = ""
return doc_str
_string_type_def = TypeDef(
name="strtype",
init="new _PrimitiveLoader(TypeGuards.String)",
instance_type="string",
)
_int_type_def = TypeDef(
name="inttype", init="new _PrimitiveLoader(TypeGuards.Int)", instance_type="number"
)
_float_type_def = TypeDef(
name="floattype",
init="new _PrimitiveLoader(TypeGuards.Float)",
instance_type="number",
)
_bool_type_def = TypeDef(
name="booltype",
init="new _PrimitiveLoader(TypeGuards.Bool)",
instance_type="boolean",
)
_null_type_def = TypeDef(
name="undefinedtype",
init="new _PrimitiveLoader(TypeGuards.Undefined)",
instance_type="undefined",
)
_any_type_def = TypeDef(name="anyType", init="new _AnyLoader()", instance_type="any")
prims = {
"http://www.w3.org/2001/XMLSchema#string": _string_type_def,
"http://www.w3.org/2001/XMLSchema#int": _int_type_def,
"http://www.w3.org/2001/XMLSchema#long": _int_type_def,
"http://www.w3.org/2001/XMLSchema#float": _float_type_def,
"http://www.w3.org/2001/XMLSchema#double": _float_type_def,
"http://www.w3.org/2001/XMLSchema#boolean": _bool_type_def,
"https://w3id.org/cwl/salad#null": _null_type_def,
"https://w3id.org/cwl/salad#Any": _any_type_def,
"string": _string_type_def,
"int": _int_type_def,
"long": _int_type_def,
"float": _float_type_def,
"double": _float_type_def,
"boolean": _bool_type_def,
"null": _null_type_def,
"Any": _any_type_def,
}
class TypeScriptCodeGen(CodeGenBase):
"""Generation of TypeScript code for a given Schema Salad definition."""
def __init__(
self, base: str, examples: Optional[str], target: Optional[str], package: str
) -> None:
"""Initialize the TypeScript codegen."""
super().__init__()
self.target_dir = Path(target or ".").resolve()
self.main_src_dir = self.target_dir / "src"
self.test_resources_dir = self.target_dir / "src" / "test" / "data"
self.package = package
self.base_uri = base
self.record_types: Set[str] = set()
self.modules: Set[str] = set()
self.id_field = ""
self.examples = examples
def prologue(self) -> None:
"""Trigger to generate the prolouge code."""
for src_dir in [self.main_src_dir]:
_safe_makedirs(src_dir)
for primitive in prims.values():
self.declare_type(primitive)
@staticmethod
def safe_name(name: str) -> str:
"""Generate a safe version of the given name."""
avn = schema.avro_field_name(name)
if avn.startswith("anon."):
avn = avn[5:]
if avn in (
"class",
"in",
"extends",
"abstract",
"default",
"package",
"arguments",
):
# reserved words
avn = avn + "_"
return avn
def begin_class(
self, # pylint: disable=too-many-arguments
classname: str,
extends: MutableSequence[str],
doc: str,
abstract: bool,
field_names: MutableSequence[str],
idfield: str,
optional_fields: Set[str],
) -> None:
"""Produce the header for the given class."""
self.current_interface = self.safe_name(classname) + "Properties"
cls = self.safe_name(classname)
self.current_class = cls
self.current_class_is_abstract = abstract
interface_module_name = self.current_interface
self.current_interface_target_file = self.main_src_dir / f"{interface_module_name}.ts"
class_module_name = self.current_class
self.current_class_target_file = self.main_src_dir / f"{class_module_name}.ts"
self.current_constructor_signature = StringIO()
self.current_constructor_body = StringIO()
self.current_loader = StringIO()
self.current_serializer = StringIO()
self.current_fieldtypes: Dict[str, TypeDef] = {}
self.idfield = idfield
doc_string = f"""
/**
* Auto-generated interface for {classname}
"""
if doc:
doc_string += " *\n"
doc_string += doc_to_doc_string(doc)
doc_string += "\n"
doc_string += " */"
self.record_types.add(f"{self.current_interface}")
self.modules.add(interface_module_name)
with open(self.current_interface_target_file, "w") as f:
_logger.info("Writing file: %s", self.current_interface_target_file)
if extends:
ext = "extends Internal." + ", Internal.".join(
self.safe_name(e) + "Properties" for e in extends
)
else:
ext = ""
f.write(
"""
import * as Internal from './util/Internal'
{docstring}
export interface {cls} {ext} {{
""".format(
docstring=doc_string,
cls=f"{self.current_interface}",
ext=ext,
)
)
if self.current_class_is_abstract:
return
self.record_types.add(cls)
self.modules.add(class_module_name)
with open(self.current_interface_target_file, "a") as f:
f.write(
"""
extensionFields?: Internal.Dictionary<any>
"""
)
doc_string = f"""
/**
* Auto-generated class implementation for {classname}
"""
if doc:
doc_string += " *\n"
doc_string += doc_to_doc_string(doc)
doc_string += "\n"
doc_string += " */"
with open(self.current_class_target_file, "w") as f:
_logger.info("Writing file: %s", self.current_class_target_file)
f.write(
"""
import {{
Dictionary,
expandUrl,
loadField,
LoaderInstances,
LoadingOptions,
Saveable,
ValidationException,
prefixUrl,
save,
saveRelativeUri
}} from './util/Internal'
import {{ v4 as uuidv4 }} from 'uuid'
import * as Internal from './util/Internal'
{docstring}
export class {cls} extends Saveable implements Internal.{current_interface} {{
extensionFields?: Internal.Dictionary<any>
""".format(
cls=cls,
current_interface=self.current_interface,
docstring=doc_string,
)
)
self.current_constructor_signature.write(
"\n" + "\n" + " constructor ({loadingOptions, extensionFields"
)
self.current_constructor_body.write(
"""
super(loadingOptions)
this.extensionFields = extensionFields ?? {}
"""
)
self.current_loader.write(
"""
/**
* Used to construct instances of {{@link {cls} }}.
*
* @param __doc Document fragment to load this record object from.
* @param baseuri Base URI to generate child document IDs against.
* @param loadingOptions Context for loading URIs and populating objects.
* @param docRoot ID at this position in the document (if available)
* @returns An instance of {{@link {cls} }}
* @throws {{@link ValidationException}} If the document fragment is not a
* {{@link Dictionary}} or validation of fields fails.
*/
static override async fromDoc (__doc: any, baseuri: string, loadingOptions: LoadingOptions,
docRoot?: string): Promise<Saveable> {{
const _doc = Object.assign({{}}, __doc)
const __errors: ValidationException[] = []
""".format(
cls=cls
)
)
self.current_serializer.write(
"""
save (top: boolean = false, baseUrl: string = '', relativeUris: boolean = true)
: Dictionary<any> {
const r: Dictionary<any> = {}
for (const ef in this.extensionFields) {
r[prefixUrl(ef, this.loadingOptions.vocab)] = this.extensionFields.ef
}
"""
)
def end_class(self, classname: str, field_names: List[str]) -> None:
"""Signal that we are done with this class."""
with open(self.current_interface_target_file, "a") as f:
f.write("}")
if self.current_class_is_abstract:
return
self.current_constructor_signature.write(
f"}} : {{loadingOptions?: LoadingOptions}} & Internal.{self.current_interface}) {{"
)
self.current_constructor_body.write(" }\n")
self.current_loader.write(
"""
const extensionFields: Dictionary<any> = {{}}
for (const [key, value] of Object.entries(_doc)) {{
if (!{classname}.attr.has(key)) {{
if ((key as string).includes(':')) {{
const ex = expandUrl(key, '', loadingOptions, false, false)
extensionFields[ex] = value
}} else {{
__errors.push(
new ValidationException(`invalid field ${{key as string}}, \\
expected one of: {fields}`)
)
break
}}
}}
}}
if (__errors.length > 0) {{
throw new ValidationException("Trying '{classname}'", __errors)
}}
const schema = new {classname}({{
extensionFields: extensionFields,
loadingOptions: loadingOptions,
""".format(
classname=self.current_class,
fields=",".join(["\\`" + f + "\\`" for f in field_names]),
)
)
self.current_loader.write(
",\n ".join(self.safe_name(f) + ": " + self.safe_name(f) for f in field_names)
+ "\n })"
)
self.current_loader.write(
"""
return schema
}
"""
)
self.current_serializer.write(
"""
if (top) {
if (this.loadingOptions.namespaces != null) {
r.$namespaces = this.loadingOptions.namespaces
}
if (this.loadingOptions.schemas != null) {
r.$schemas = this.loadingOptions.schemas
}
}
return r
}
"""
)
with open(
self.current_class_target_file,
"a",
) as f:
f.write(self.current_constructor_signature.getvalue())
f.write(self.current_constructor_body.getvalue())
f.write(self.current_loader.getvalue())
f.write(self.current_serializer.getvalue())
f.write(
"\n"
+ " static attr: Set<string> = new Set(["
+ ",".join(["'" + shortname(f) + "'" for f in field_names])
+ "])"
)
f.write(
"""
}
"""
)
def type_loader(self, type_declaration: Union[List[Any], Dict[str, Any], str]) -> TypeDef:
"""Parse the given type declaration and declare its components."""
if isinstance(type_declaration, MutableSequence):
sub_types = [self.type_loader(i) for i in type_declaration]
sub_names: List[str] = list(dict.fromkeys([i.name for i in sub_types]))
sub_instance_types: List[str] = list(
dict.fromkeys([i.instance_type for i in sub_types if i.instance_type is not None])
)
return self.declare_type(
TypeDef(
"unionOf{}".format("Or".join(sub_names)),
"new _UnionLoader([{}])".format(", ".join(sub_names)),
instance_type=" | ".join(sub_instance_types),
)
)
if isinstance(type_declaration, MutableMapping):
if type_declaration["type"] in (
"array",
"https://w3id.org/cwl/salad#array",
):
i = self.type_loader(type_declaration["items"])
return self.declare_type(
TypeDef(
f"arrayOf{i.name}",
f"new _ArrayLoader([{i.name}])",
instance_type=f"Array<{i.instance_type}>",
)
)
if type_declaration["type"] in ("enum", "https://w3id.org/cwl/salad#enum"):
return self.type_loader_enum(type_declaration)
if type_declaration["type"] in (
"record",
"https://w3id.org/cwl/salad#record",
):
return self.declare_type(
TypeDef(
self.safe_name(type_declaration["name"]) + "Loader",
"new _RecordLoader({}.fromDoc)".format(
self.safe_name(type_declaration["name"]),
),
instance_type="Internal." + self.safe_name(type_declaration["name"]),
abstract=type_declaration.get("abstract", False),
)
)
raise SchemaException("wft {}".format(type_declaration["type"]))
if type_declaration in prims:
return prims[type_declaration]
if type_declaration in ("Expression", "https://w3id.org/cwl/cwl#Expression"):
return self.declare_type(
TypeDef(
self.safe_name(type_declaration) + "Loader",
"new _ExpressionLoader()",
instance_type="string",
)
)
return self.collected_types[self.safe_name(type_declaration) + "Loader"]
def type_loader_enum(self, type_declaration: Dict[str, Any]) -> TypeDef:
for sym in type_declaration["symbols"]:
self.add_vocab(shortname(sym), sym)
enum_name = self.safe_name(type_declaration["name"])
enum_module_name = enum_name
enum_path = self.main_src_dir / f"{enum_module_name}.ts"
self.modules.add(enum_module_name)
self.record_types.add(enum_name)
with open(enum_path, "w") as f:
_logger.info("Writing file: %s", enum_path)
f.write(
"""
export enum {enum_name} {{
""".format(
enum_name=enum_name
)
)
for sym in type_declaration["symbols"]:
val = self.safe_name(sym)
const = self.safe_name(sym).replace("-", "_").replace(".", "_").upper()
f.write(f""" {const}='{val}',\n""") # noqa: B907
f.write(
"""}
"""
)
return self.declare_type(
TypeDef(
instance_type="Internal." + enum_name,
name=self.safe_name(type_declaration["name"]) + "Loader",
init=f"new _EnumLoader((Object.keys({enum_name}) as Array<keyof typeof "
f"{enum_name}>).map(key => {enum_name}[key]))",
)
)
def declare_field(
self,
name: str,
fieldtype: TypeDef,
doc: Optional[str],
optional: bool,
subscope: str,
) -> None:
"""Output the code to load the given field."""
safename = self.safe_name(name)
fieldname = shortname(name)
self.current_fieldtypes[safename] = fieldtype
if fieldtype.instance_type is not None and "undefined" in fieldtype.instance_type:
optionalstring = "?"
else:
optionalstring = ""
with open(self.current_interface_target_file, "a") as f:
if doc:
f.write(
"""
/**
{doc_str}
*/
""".format(
doc_str=doc_to_doc_string(doc, indent_level=1)
)
)
if fieldname == "class":
f.write(
" {safename}{optionalstring}: {type}\n".format(
safename=safename,
type=fieldtype.instance_type,
optionalstring="?",
)
)
else:
f.write(
" {safename}{optionalstring}: {type}\n".format(
safename=safename,
type=fieldtype.instance_type,
optionalstring=optionalstring,
)
)
if self.current_class_is_abstract:
return
with open(self.current_class_target_file, "a") as f:
if doc:
f.write(
"""
/**
{doc_str}
*/
""".format(
doc_str=doc_to_doc_string(doc, indent_level=1)
)
)
f.write(
" {safename}{optionalstring}: {type}\n".format(
safename=safename,
type=fieldtype.instance_type,
optionalstring=optionalstring,
)
)
if fieldname == "class":
if fieldtype.instance_type == "string":
self.current_constructor_signature.write(
f", {safename} = '{self.current_class}'" # noqa: B907
)
else:
self.current_constructor_signature.write(
", {safename} = {type}.{val}".format(
safename=safename,
type=fieldtype.instance_type,
val=self.current_class.replace("-", "_").replace(".", "_").upper(),
)
)
else:
self.current_constructor_signature.write(
", {safename}".format(
safename=safename,
)
)
self.current_constructor_body.write(
" this.{safeName} = {safeName}\n".format(safeName=safename)
)
self.current_loader.write(
"""
let {safename}""".format(
safename=safename
)
)
if optional:
self.current_loader.write(
"""
if ('{fieldname}' in _doc) {{""".format(
fieldname=fieldname
)
)
spc = " "
else:
spc = ""
self.current_loader.write(
"""
{spc} try {{
{spc} {safename} = await loadField(_doc.{fieldname}, LoaderInstances.{fieldtype},
{spc} baseuri, loadingOptions)
{spc} }} catch (e) {{
{spc} if (e instanceof ValidationException) {{
{spc} __errors.push(
{spc} new ValidationException('the `{fieldname}` field is not valid because: ', [e])
{spc} )
{spc} }} else {{
{spc} throw e
{spc} }}
{spc} }}
""".format(
safename=safename,
fieldname=fieldname,
fieldtype=fieldtype.name,
spc=spc,
)
)
if optional:
self.current_loader.write(" }\n")
if name == self.idfield or not self.idfield:
baseurl = "baseUrl"
else:
baseurl = f"this.{self.safe_name(self.idfield)}"
if fieldtype.is_uri:
self.current_serializer.write(
"""
if (this.{safename} != null) {{
const u = saveRelativeUri(this.{safename}, {base_url}, {scoped_id},
relativeUris, {ref_scope})
if (u != null) {{
r.{fieldname} = u
}}
}}
""".format(
safename=self.safe_name(name),
fieldname=shortname(name).strip(),
base_url=baseurl,
scoped_id=self.to_typescript(fieldtype.scoped_id),
ref_scope=self.to_typescript(fieldtype.ref_scope),
)
)
else:
self.current_serializer.write(
"""
if (this.{safename} != null) {{
r.{fieldname} = save(this.{safename}, false, {base_url}, relativeUris)
}}
""".format(
safename=self.safe_name(name),
fieldname=shortname(name).strip(),
base_url=baseurl,
)
)
def declare_id_field(
self,
name: str,
fieldtype: TypeDef,
doc: str,
optional: bool,
) -> None:
"""Output the code to handle the given ID field."""
self.declare_field(name, fieldtype, doc, True, "")
if optional:
opt = f"""{self.safe_name(name)} = "_" + uuidv4()"""
else:
opt = """throw new ValidationException("Missing {fieldname}")""".format(
fieldname=shortname(name)
)
self.current_loader.write(
"""
const original{safename}IsUndefined = ({safename} === undefined)
if (original{safename}IsUndefined ) {{
if (docRoot != null) {{
{safename} = docRoot
}} else {{
{opt}
}}
}} else {{
baseuri = {safename} as string
}}
""".format(
safename=self.safe_name(name), opt=opt
)
)
def to_typescript(self, val: Any) -> Any:
"""Convert a Python keyword to a TypeScript keyword."""
if val is True:
return "true"
elif val is None:
return "undefined"
elif val is False:
return "false"
return val
def uri_loader(
self,
inner: TypeDef,
scoped_id: bool,
vocab_term: bool,
ref_scope: Optional[int],
) -> TypeDef:
"""Construct the TypeDef for the given URI loader."""
instance_type = inner.instance_type or "any"
return self.declare_type(
TypeDef(
f"uri{inner.name}{scoped_id}{vocab_term}{ref_scope}",
"new _URILoader({}, {}, {}, {})".format(
inner.name,
self.to_typescript(scoped_id),
self.to_typescript(vocab_term),
self.to_typescript(ref_scope),
),
is_uri=True,
scoped_id=scoped_id,
ref_scope=ref_scope,
instance_type=instance_type,
)
)
def idmap_loader(
self, field: str, inner: TypeDef, map_subject: str, map_predicate: Optional[str]
) -> TypeDef:
"""Construct the TypeDef for the given mapped ID loader."""
instance_type = inner.instance_type or "any"
return self.declare_type(
TypeDef(
f"idmap{self.safe_name(field)}{inner.name}",
f"new _IdMapLoader({inner.name}, '{map_subject}', '{map_predicate}')", # noqa: B907
instance_type=instance_type,
)
)
def typedsl_loader(self, inner: TypeDef, ref_scope: Optional[int]) -> TypeDef:
"""Construct the TypeDef for the given DSL loader."""
instance_type = inner.instance_type or "any"
return self.declare_type(
TypeDef(
f"typedsl{self.safe_name(inner.name)}{ref_scope}",
f"new _TypeDSLLoader({self.safe_name(inner.name)}, {ref_scope})",
instance_type=instance_type,
)
)
def epilogue(self, root_loader: TypeDef) -> None:
"""Trigger to generate the epilouge code."""
pd = "This project contains TypeScript objects and utilities "
pd = pd + ' auto-generated by <a href=\\"https://github.com/'
pd = pd + 'common-workflow-language/schema_salad\\">Schema Salad</a>'
pd = pd + " for parsing documents corresponding to the "
pd = pd + str(self.base_uri) + " schema."
sorted_record_types = sorted(self.record_types)
generated_class_imports = ",\n ".join(sorted_record_types)
template_vars: MutableMapping[str, str] = dict(
project_name=self.package,
version="0.0.1-SNAPSHOT",
project_description=pd,
license_name="Apache License, Version 2.0",
generated_class_imports=generated_class_imports,
)
def template_from_resource(resource: Path) -> string.Template:
template_str = resource.read_text("utf-8")
template = string.Template(template_str)
return template
def expand_resource_template_to(resource: str, path: Path) -> None:
template = template_from_resource(
files("schema_salad").joinpath(f"typescript/{resource}")
)
src = template.safe_substitute(template_vars)
_ensure_directory_and_write(path, src)
expand_resource_template_to("package.json", self.target_dir / "package.json")
expand_resource_template_to(".gitignore", self.target_dir / ".gitignore")
expand_resource_template_to("LICENSE", self.target_dir / "LICENSE")
expand_resource_template_to("tsconfig.json", self.target_dir / "tsconfig.json")
expand_resource_template_to("index.ts", self.main_src_dir / "index.ts")
vocab = ",\n ".join(
f"""'{k}': '{self.vocab[k]}'""" for k in sorted(self.vocab.keys()) # noqa: B907
)
rvocab = ",\n ".join(
f"""'{self.vocab[k]}': '{k}'""" for k in sorted(self.vocab.keys()) # noqa: B907
)
loader_instances = ""
for _, collected_type in self.collected_types.items():
if not collected_type.abstract:
loader_instances += "export const {} = {};\n".format(
collected_type.name, collected_type.init
)
sorted_modules = sorted(self.modules)
internal_module_exports = "\n".join(f"export * from '../{f}'" for f in sorted_modules)
example_tests = ""
if self.examples:
_safe_makedirs(self.test_resources_dir)
utils_resources = self.test_resources_dir / "examples"
if os.path.exists(utils_resources):
shutil.rmtree(utils_resources)
shutil.copytree(self.examples, utils_resources)
for example_name in os.listdir(self.examples):
if example_name.startswith("valid"):
basename = os.path.basename(example_name).rsplit(".", 1)[0]
example_tests += """
it('{basename}', async () => {{
await loadDocument(__dirname + '/data/examples/{example_name}')
}})
it('{basename} by string', async () => {{
let doc = fs.readFileSync(__dirname + '/data/examples/{example_name}').toString()
await loadDocumentByString(doc, url.pathToFileURL(__dirname +
'/data/examples/').toString())
}})""".format(
basename=basename.replace("-", "_").replace(".", "_"),
example_name=example_name,
)
template_args: MutableMapping[str, str] = dict(
internal_module_exports=internal_module_exports,
loader_instances=loader_instances,
generated_class_imports=generated_class_imports,
vocab=vocab,
rvocab=rvocab,
root_loader=root_loader.name,
root_loader_type=root_loader.instance_type or "any",
tests=example_tests,
)
util_src_dirs = {
"util": self.main_src_dir / "util",
"test": self.main_src_dir / "test",
}
def copy_utils_recursive(util_src: str, util_target: Path) -> None:
for util in files("schema_salad").joinpath(f"typescript/{util_src}").iterdir():
if util.is_dir():
copy_utils_recursive(os.path.join(util_src, util.name), util_target / util.name)
continue
src_path = util_target / util.name
src_template = template_from_resource(util)
src = src_template.safe_substitute(template_args)
_ensure_directory_and_write(src_path, src)
for util_src, util_target in util_src_dirs.items():
copy_utils_recursive(util_src, util_target)
def secondaryfilesdsl_loader(self, inner: TypeDef) -> TypeDef:
"""Construct the TypeDef for secondary files."""
instance_type = inner.instance_type or "any"
return self.declare_type(
TypeDef(
f"secondaryfilesdsl{inner.name}",
f"new _SecondaryDSLLoader({inner.name})",
instance_type=instance_type,
)
)
|
/schema-salad-8.4.20230808163024.tar.gz/schema-salad-8.4.20230808163024/schema_salad/typescript_codegen.py
| 0.693058 | 0.178956 |
typescript_codegen.py
|
pypi
|
from typing import List, Optional, Sequence, Tuple, Union
from .sourceline import SourceLine, reflow_all, strip_duplicated_lineno
class SchemaSaladException(Exception):
"""Base class for all schema-salad exceptions."""
def __init__(
self,
msg: str,
sl: Optional[SourceLine] = None,
children: Optional[Sequence["SchemaSaladException"]] = None,
bullet_for_children: str = "",
) -> None:
super().__init__(msg)
self.message = self.args[0]
self.file: Optional[str] = None
self.start: Optional[Tuple[int, int]] = None
self.end: Optional[Tuple[int, int]] = None
self.is_warning: bool = False
# It will be set by its parent
self.bullet: str = ""
def simplify(exc: "SchemaSaladException") -> List["SchemaSaladException"]:
return [exc] if len(exc.message) else exc.children
def with_bullet(exc: "SchemaSaladException", bullet: str) -> "SchemaSaladException":
if exc.bullet == "":
exc.bullet = bullet
return exc
if children is None:
self.children: List["SchemaSaladException"] = []
elif len(children) <= 1:
self.children = sum((simplify(c) for c in children), [])
else:
self.children = sum(
(simplify(with_bullet(c, bullet_for_children)) for c in children), []
)
self.with_sourceline(sl)
self.propagate_sourceline()
def propagate_sourceline(self) -> None:
if self.file is None:
return
for c in self.children:
if c.file is None:
c.file = self.file
c.start = self.start
c.end = self.end
c.propagate_sourceline()
def as_warning(self) -> "SchemaSaladException":
self.is_warning = True
for c in self.children:
c.as_warning()
return self
def with_sourceline(self, sl: Optional[SourceLine]) -> "SchemaSaladException":
if sl and sl.file():
self.file = sl.file()
self.start = sl.start()
self.end = sl.end()
else:
self.file = None
self.start = None
self.end = None
return self
def leaves(self) -> List["SchemaSaladException"]:
if len(self.children) > 0:
return sum((c.leaves() for c in self.children), [])
if len(self.message):
return [self]
return []
def prefix(self) -> str:
pre: str = ""
if self.file:
linecol0: Union[int, str] = ""
linecol1: Union[int, str] = ""
if self.start:
linecol0, linecol1 = self.start
pre = f"{self.file}:{linecol0}:{linecol1}: "
return pre + "Warning: " if self.is_warning else pre
def summary(self, level: int = 0, with_bullet: bool = False) -> str:
indent_per_level = 2
spaces = (level * indent_per_level) * " "
bullet = self.bullet + " " if len(self.bullet) > 0 and with_bullet else ""
return f"{self.prefix()}{spaces}{bullet}{self.message}"
def __str__(self) -> str:
"""Convert to a string using :py:meth:`pretty_str`."""
return str(self.pretty_str())
def pretty_str(self, level: int = 0) -> str:
messages = len(self.message)
my_summary = [self.summary(level, True)] if messages else []
next_level = level + 1 if messages else level
ret = "\n".join(e for e in my_summary + [c.pretty_str(next_level) for c in self.children])
if level == 0:
return strip_duplicated_lineno(reflow_all(ret))
return ret
class SchemaException(SchemaSaladException):
"""Indicates error with the provided schema definition."""
class ValidationException(SchemaSaladException):
"""Indicates error with document against the provided schema."""
class ClassValidationException(ValidationException):
pass
def to_one_line_messages(exc: SchemaSaladException) -> str:
return "\n".join(c.summary() for c in exc.leaves())
|
/schema-salad-8.4.20230808163024.tar.gz/schema-salad-8.4.20230808163024/schema_salad/exceptions.py
| 0.917488 | 0.261343 |
exceptions.py
|
pypi
|
# Semantic Annotations for Linked Avro Data (SALAD)
Author:
* Peter Amstutz <[email protected]>, Curii Corporation
Contributors:
* The developers of Apache Avro
* The developers of JSON-LD
* Nebojša Tijanić <[email protected]>, Seven Bridges Genomics
* Michael R. Crusoe, ELIXIR-DE
# Abstract
Salad is a schema language for describing structured linked data documents
in JSON or YAML documents. A Salad schema provides rules for
preprocessing, structural validation, and link checking for documents
described by a Salad schema. Salad builds on JSON-LD and the Apache Avro
data serialization system, and extends Avro with features for rich data
modeling such as inheritance, template specialization, object identifiers,
and object references. Salad was developed to provide a bridge between the
record oriented data modeling supported by Apache Avro and the Semantic
Web.
# Status of This Document
This document is the product of the [Common Workflow Language working
group](https://groups.google.com/forum/#!forum/common-workflow-language). The
latest version of this document is available in the "schema_salad" repository at
https://github.com/common-workflow-language/schema_salad
The products of the CWL working group (including this document) are made available
under the terms of the Apache License, version 2.0.
<!--ToC-->
# Introduction
The JSON data model is an extremely popular way to represent structured
data. It is attractive because of its relative simplicity and is a
natural fit with the standard types of many programming languages.
However, this simplicity means that basic JSON lacks expressive features
useful for working with complex data structures and document formats, such
as schemas, object references, and namespaces.
JSON-LD is a W3C standard providing a way to describe how to interpret a
JSON document as Linked Data by means of a "context". JSON-LD provides a
powerful solution for representing object references and namespaces in JSON
based on standard web URIs, but is not itself a schema language. Without a
schema providing a well defined structure, it is difficult to process an
arbitrary JSON-LD document as idiomatic JSON because there are many ways to
express the same data that are logically equivalent but structurally
distinct.
Several schema languages exist for describing and validating JSON data,
such as the Apache Avro data serialization system, however none understand
linked data. As a result, to fully take advantage of JSON-LD to build the
next generation of linked data applications, one must maintain separate
JSON schema, JSON-LD context, RDF schema, and human documentation, despite
significant overlap of content and obvious need for these documents to stay
synchronized.
Schema Salad is designed to address this gap. It provides a schema
language and processing rules for describing structured JSON content
permitting URI resolution and strict document validation. The schema
language supports linked data through annotations that describe the linked
data interpretation of the content, enables generation of JSON-LD context
and RDF schema, and production of RDF triples by applying the JSON-LD
context. The schema language also provides for robust support of inline
documentation.
## Introduction to v1.1
This is the third version of the Schema Salad specification. It is
developed concurrently with v1.1 of the Common Workflow Language for use in
specifying the Common Workflow Language, however Schema Salad is intended to be
useful to a broader audience. Compared to the v1.0 schema salad
specification, the following changes have been made:
* Support for `default` values on record fields to specify default values
* Add subscoped fields (fields which introduce a new inner scope for identifiers)
* Add the *inVocab* flag (default true) to indicate if a type is added to the vocabulary of well known terms or must be prefixed
* Add *secondaryFilesDSL* micro DSL (domain specific language) to convert text strings to a secondaryFiles record type used in CWL
* The `$mixin` feature has been removed from the specification, as it
is poorly documented, not included in conformance testing,
and not widely supported.
## Introduction to v1.2
This is the fourth version of the Schema Salad specification. It was created to
ease the development of extensions to CWL v1.2. The only change is that
inherited records can narrow the types of fields if those fields are re-specified
with a matching jsonldPredicate.
## References to Other Specifications
**Javascript Object Notation (JSON)**: http://json.org
**JSON Linked Data (JSON-LD)**: http://json-ld.org
**YAML**: https://yaml.org/spec/1.2/spec.html
**Avro**: https://avro.apache.org/docs/current/spec.html
**Uniform Resource Identifier (URI) Generic Syntax**: https://tools.ietf.org/html/rfc3986)
**Resource Description Framework (RDF)**: http://www.w3.org/RDF/
**UTF-8**: https://www.ietf.org/rfc/rfc2279.txt)
## Scope
This document describes the syntax, data model, algorithms, and schema
language for working with Salad documents. It is not intended to document
a specific implementation of Salad, however it may serve as a reference for
the behavior of conforming implementations.
## Terminology
The terminology used to describe Salad documents is defined in the Concepts
section of the specification. The terms defined in the following list are
used in building those definitions and in describing the actions of a
Salad implementation:
**may**: Conforming Salad documents and Salad implementations are permitted but
not required to be interpreted as described.
**must**: Conforming Salad documents and Salad implementations are required
to be interpreted as described; otherwise they are in error.
**error**: A violation of the rules of this specification; results are
undefined. Conforming implementations may detect and report an error and may
recover from it.
**fatal error**: A violation of the rules of this specification; results
are undefined. Conforming implementations must not continue to process the
document and may report an error.
**at user option**: Conforming software may or must (depending on the modal verb in
the sentence) behave as described; if it does, it must provide users a means to
enable or disable the behavior described.
# Document model
## Data concepts
An **object** is a data structure equivalent to the "object" type in JSON,
consisting of a unordered set of name/value pairs (referred to here as
**fields**) and where the name is a string and the value is a string, number,
boolean, array, or object.
A **document** is a file containing a serialized object, or an array of
objects.
A **document type** is a class of files that share a common structure and
semantics.
A **document schema** is a formal description of the grammar of a document type.
A **base URI** is a context-dependent URI used to resolve relative references.
An **identifier** is a URI that designates a single document or single
object within a document.
A **vocabulary** is the set of symbolic field names and enumerated symbols defined
by a document schema, where each term maps to absolute URI.
## Syntax
Conforming Salad v1.1 documents are serialized and loaded using a
subset of YAML 1.2 syntax and UTF-8 text encoding. Salad documents
are written using the [JSON-compatible subset of YAML described in
section 10.2](https://yaml.org/spec/1.2/spec.html#id2803231). The
following features of YAML must not be used in conforming Salad
documents:
* Use of explicit node tags with leading `!` or `!!`
* Use of anchors with leading `&` and aliases with leading `*`
* %YAML directives
* %TAG directives
It is a fatal error if the document is not valid YAML.
A Salad document must consist only of either a single root object or an
array of objects.
## Document context
### Implied context
The implicit context consists of the vocabulary defined by the schema and
the base URI. By default, the base URI must be the URI that was used to
load the document. It may be overridden by an explicit context.
### Explicit context
If a document consists of a root object, this object may contain the
fields `$base`, `$namespaces`, `$schemas`, and `$graph`:
* `$base`: Must be a string. Set the base URI for the document used to
resolve relative references.
* `$namespaces`: Must be an object with strings as values. The keys of
the object are namespace prefixes used in the document; the values of
the object are the prefix expansions.
* `$schemas`: Must be an array of strings. This field may list URI
references to documents in RDF-XML format which will be queried for RDF
schema data. The subjects and predicates described by the RDF schema
may provide additional semantic context for the document, and may be
used for validation of prefixed extension fields found in the document.
Other directives beginning with `$` must be ignored.
## Document graph
If a document consists of a single root object, this object may contain the
field `$graph`. This field must be an array of objects. If present, this
field holds the primary content of the document. A document that consists
of array of objects at the root is an implicit graph.
## Document metadata
If a document consists of a single root object, metadata about the
document, such as authorship, may be declared in the root object.
## Document schema
Document preprocessing, link validation and schema validation require a
document schema. A schema may consist of:
* At least one record definition object which defines valid fields that
make up a record type. Record field definitions include the valid types
that may be assigned to each field and annotations to indicate fields
that represent identifiers and links, described below in "Semantic
Annotations".
* Any number of enumerated type objects which define a set of finite set of symbols that are
valid value of the type.
* Any number of documentation objects which allow in-line documentation of the schema.
The schema for defining a salad schema (the metaschema) is described in
detail in the [Schema](#Schema) section.
## Record field annotations
In a document schema, record field definitions may include the field
`jsonldPredicate`, which may be either a string or object. Implementations
must use the following document preprocessing of fields by the following
rules:
* If the value of `jsonldPredicate` is `@id`, the field is an identifier
field.
* If the value of `jsonldPredicate` is an object, and that
object contains the field `_type` with the value `@id`, the
field is a link field. If the field `jsonldPredicate` also
has the field `identity` with the value `true`, the field is
resolved with [identifier resolution](#Identifier_resolution).
Otherwise it is resolved with [link resolution](#Link_resolution).
* If the value of `jsonldPredicate` is an object which contains the
field `_type` with the value `@vocab`, the field value is subject to
[vocabulary resolution](#Vocabulary_resolution).
## Document traversal
To perform document preprocessing, link validation and schema
validation, the document must be traversed starting from the fields or
array items of the root object or array and recursively visiting each child
item which contains an object or arrays.
## Short names
The "short name" of a fully qualified identifier is the portion of
the identifier following the final slash `/` of either the fragment
identifier following `#` or the path portion, if there is no fragment.
Some examples:
* the short name of `http://example.com/foo` is `foo`
* the short name of `http://example.com/#bar` is `bar`
* the short name of `http://example.com/foo/bar` is `bar`
* the short name of `http://example.com/foo#bar` is `bar`
* the short name of `http://example.com/#foo/bar` is `bar`
* the short name of `http://example.com/foo#bar/baz` is `baz`
## Inheritance and specialization
A record definition may inherit from one or more record definitions
with the `extends` field. This copies the fields defined in the
parent record(s) as the base for the new record. A record definition
may `specialize` type declarations of the fields inherited from the
base record. For each field inherited from the base record, any
instance of the type in `specializeFrom` is replaced with the type in
`specializeTo`. The type in `specializeTo` should extend from the
type in `specializeFrom`.
A record definition may be `abstract`. This means the record
definition is not used for validation on its own, but may be extended
by other definitions. If an abstract type appears in a field
definition, it is logically replaced with a union of all concrete
subtypes of the abstract type. In other words, the field value does
not validate as the abstract type, but must validate as some concrete
type that inherits from the abstract type.
# Document preprocessing
After processing the explicit context (if any), document preprocessing
begins. Starting from the document root, object fields values or array
items which contain objects or arrays are recursively traversed
depth-first. For each visited object, field names, identifier fields, link
fields, vocabulary fields, and `$import` and `$include` directives must be
processed as described in this section. The order of traversal of child
nodes within a parent node is undefined.
|
/schema-salad-8.4.20230808163024.tar.gz/schema-salad-8.4.20230808163024/schema_salad/metaschema/salad.md
| 0.915838 | 0.75593 |
salad.md
|
pypi
|
from typing import List, Dict, Optional, Union
from dataclasses import dataclass
import xml.etree.ElementTree as ET
import os
@dataclass(frozen=True)
class St4Entry():
type:str
label:str
node_id:str
link_id:str
titles:Dict[str,str]
content:Dict[str,str]
thumbnail:Optional[str]=None
data_web:Optional[Dict[str,str]]=None
data_web_data:Optional[Dict[str,str]]=None
@property
def languages(self)->List[str]:
if len(self.content) == 0:
return list(self.titles.keys())
return list(self.content.keys())
def get_namespaces(xml_file:Union[str, os.PathLike])->Dict[str,str]:
"""
Extracts the namespaces from a schema st4 xml file
"""
namespaces = {}
for event, elem in ET.iterparse(xml_file, events=("start", "start-ns")):
if event == "start-ns":
prefix, url = elem
namespaces[prefix] = url
return namespaces
def parse(xml_file:Union[str, os.PathLike])->List[St4Entry]:
"""
Parses a schema st4 xml file and returns a list of St4Entry objects
"""
namespaces = get_namespaces(xml_file)
assert "n" in namespaces and "l" in namespaces , "No namespaces found! Is this a valid ST4 file?"
extracted_entries=[]
def extract_language_and_values(element:ET.Element,with_entry=False)->Dict[str,str]:
extracted={}
value_elements = element.findall("./n:Value",namespaces)
for value_element in value_elements:
language = value_element.attrib[(f"{'{'+namespaces['n']+'}'}Aspect")]
if with_entry:
entry_element = value_element.find(".//n:Entry",namespaces)
if entry_element is not None:
extracted[language]=entry_element.text
else:
extracted[language]=value_element.text
return extracted
tree = ET.parse(xml_file)
root = tree.getroot()
# Find all 'n:SystemFolder' elements
system_folder_elements = root.findall(".//n:SystemFolder",namespaces)
for system_folder_element in system_folder_elements:
#get info elements
info_elements = system_folder_element.findall(".//n:Data-Title/..",namespaces) #Just dont ask me why, but im not gonna hardcode the InfoType02 element
if info_elements is None:
continue
for info_element in info_elements:
#extract label and ids
type=info_element.tag
label = info_element.attrib[(f"{'{'+namespaces['l']+'}'}Label")]
node_id = info_element.attrib[(f"{'{'+namespaces['n']+'}'}Id")]
link_id = info_element.attrib[(f"{'{'+namespaces['l']+'}'}Id")]
#extract the titles in all languages
title_element = info_element.find(".//n:Data-Title",namespaces)
titles=extract_language_and_values(title_element,with_entry=True)
#get the content in all languages
data_content_element = info_element.find(".//n:Data-Content",namespaces)
content={}
if data_content_element is not None:
value_elements = data_content_element.findall("./n:Value",namespaces)
for value_element in value_elements:
language = value_element.attrib[(f"{'{'+namespaces['n']+'}'}Aspect")]
content_element = value_element.find(".//n:Entry//content",namespaces)
content[language]= ET.tostring(content_element, encoding='unicode')
#check if we got content or titles, if not, skip this entry
if len(titles)==0 and len(content)==0:
continue
#get thumbnail if it exists
thumbnail=None
thumbnail_element = info_element.find(".//n:Data-Thumbnail",namespaces)
if thumbnail_element is not None:
thumbnail = thumbnail_element.text
#get data web if it exists
data_web = None
data_web_element = info_element.find(".//n:Data-Web",namespaces)
if data_web_element is not None:
data_web = extract_language_and_values(data_web_element)
# get data web.data if it exists // dont ask me why it is named this way, its just stupid
data_web_data = None
data_web_data_element = info_element.find(".//n:Data-Web.Data",namespaces)
if data_web_data_element is not None:
data_web_data = extract_language_and_values(data_web_data_element)
extracted_entries.append(St4Entry(type,label,node_id,link_id,titles,content,thumbnail,data_web,data_web_data))
return extracted_entries
|
/schema_st4_parser-1.0.1.tar.gz/schema_st4_parser-1.0.1/src/schema_st4_parser/__init__.py
| 0.507324 | 0.214229 |
__init__.py
|
pypi
|
class SchemaNode(object):
def __init__(self, line, column):
self._line = line
self._column = column
class ValueNode(SchemaNode):
def __init__(self, value, line, column):
super().__init__(line, column)
self._value = value
def replace(self, find, replace_by):
return self._value.replace(find, replace_by)
def __repr__(self):
return "ValueNode(value={}, line={}, column={})".format(
self._value, self._line, self._column
)
def __call__(self):
return self._value
def __eq__(self, other):
if not isinstance(other, self.__class__): return NotImplemented
return self._value == other._value
def __hash__(self):
return hash( (self._value, self._line, self._column) )
class ListNode(SchemaNode):
def __init__(self, items, line, column):
super().__init__(line, column)
self._items = items
self.current = -1
def __iter__(self):
return iter(self._items)
def __setitem__(self, key, item):
self._items[key] = item
def __getitem__(self, key):
return self._items[key]
def __repr__(self):
return "ListNode(len={}, line={}, column={})".format(
len(self._items), self._line, self._column
)
def __call__(self):
return [ v() for v in self ]
def __eq__(self, other):
if not isinstance(other, self.__class__): return NotImplemented
for index, _ in enumerate(self._items):
if self._items[index] != other._items[index]: return False
return True
class ObjectNode(SchemaNode):
def __init__(self, items, line, column):
super().__init__(line, column)
self._items = items
def __iter__(self):
return iter(self._items.items())
def __setitem__(self, key, item):
self._items[key] = item
def __getitem__(self, key):
return self._items[key]
def __getattr__(self, key):
return self._items[key]
def __repr__(self):
return "ObjectNode(len={}, line={}, column={})".format(
len(self._items), self._line, self._column
)
def __len__(self):
return len(self._items)
def __delitem__(self, key):
del self._items[key]
def clear(self):
return self._items.clear()
def copy(self):
return self._items.copy()
def has_key(self, k):
return k in self._items
def __contains__(self, k):
return k in self._items
def update(self, *args, **kwargs):
return self._items.update(*args, **kwargs)
def keys(self):
return self._items.keys()
def values(self):
return self._items.values()
def items(self):
return self._items.items()
def __call__(self):
return {
k : v() for k, v in self.items()
}
def __eq__(self, other):
if not isinstance(other, self.__class__): return NotImplemented
for key in self._items.keys():
if self._items[key] != other._items[key]: return False
return True
|
/schema_tools-0.0.19-py3-none-any.whl/schema_tools/ast.py
| 0.760828 | 0.196884 |
ast.py
|
pypi
|
from collections import namedtuple
from schema_tools.ast import ValueNode, ListNode, ObjectNode
location = namedtuple("NodeLocation", "line column")
def node_location(node):
try:
return location(node._line, node._column)
except AttributeError:
raise TypeError("Expected a config node but received a {}.".format(
node.__class__.__name__
))
class VisitorException(Exception): pass
class Visitor(object):
def __init__(self, value_class, list_class, object_class):
self.value_class = value_class
self.list_class = list_class
self.object_class = object_class
def visit(self, obj):
try:
if isinstance(obj, self.object_class):
return self.visit_object(obj)
elif isinstance(obj, self.list_class):
return self.visit_list(obj)
elif isinstance(obj, self.value_class):
return self.visit_value(obj)
else:
raise TypeError("Node type '{}' is not supported by '{}'".format(
obj.__class__.__name__, self.__class__.__name__
))
except VisitorException as e:
raise e
except Exception as e:
raise VisitorException("Failed to visit '{}', due to '{}'".format(
repr(obj),
str(e)
))
def visit_value(self, value_node):
raise NotImplementedError
def visit_list(self, list_node):
raise NotImplementedError
def visit_object(self, object_node):
raise NotImplementedError
class ASTVisitor(Visitor):
def __init__(self):
super().__init__(ValueNode, ListNode, ObjectNode)
self.level = 0
def location(self, node):
return node_location(node)
def visit_value(self, value_node):
raise NotImplementedError
def visit_list(self, list_node):
self.level += 1
children = [ self.visit(item) for item in list_node ]
self.level -= 1
return children
def visit_object(self, object_node):
self.level += 1
children = { str(key) : self.visit(child) for key, child in object_node.items() }
self.level -= 1
return children
class ASTDumper(ASTVisitor):
def dump(self, node):
return "\n".join(self.visit(node))
def indent(self):
return " " * self.level
def location(self, node):
location = super().location(node)
# don't take into account column ;-)
return "[{},{}]{} ".format(*location, self.indent())
def visit_value(self, value_node):
return "{}{}".format(self.location(value_node), value_node())
def visit_object(self, object_node):
children = []
for key, child in super().visit_object(object_node).items():
# reuse location of child for key
children.append("{}{}".format(self.location(object_node[key]), key))
if isinstance(child, list):
children.extend(child)
else:
children.append(child)
return children
|
/schema_tools-0.0.19-py3-none-any.whl/schema_tools/utils.py
| 0.675978 | 0.283381 |
utils.py
|
pypi
|
import requests
from requests_file import FileAdapter
from urllib.parse import urldefrag, urlparse
from pathlib import Path
from schema_tools import json, yaml
from schema_tools.schema import Schema, Mapper, loads, IdentifiedSchema, ConstantValueSchema
def log(*args):
if False: print(*args)
class ObjectSchema(IdentifiedSchema):
def __init__(self, properties=None, definitions=None,
allOf=None, anyOf=None, oneOf=None,
**kwargs):
super().__init__(**kwargs)
if properties is None: properties = []
self.properties = properties
if isinstance(self.properties, list):
for prop in self.properties:
prop.parent = self
elif isinstance(self.properties, ConstantValueSchema):
if self.properties.value is None:
self.properties = []
else:
raise ValueError("can't handle properties", self.properties)
self.definitions = []
if definitions:
for definition in definitions:
self.add_definition(definition)
self.allOf = allOf
if self.allOf: self.allOf.parent = self
self.anyOf = anyOf
if self.anyOf: self.anyOf.parent = self
self.oneOf = oneOf
if self.oneOf: self.oneOf.parent = self
def add_definition(self, definition):
definition.parent = self
self.definitions.append(definition)
def definition(self, key, return_definition=True):
for definition in self.definitions:
if definition.name == key:
return definition.definition if return_definition else definition
raise KeyError("'{}' is not a known definition".format(key))
def _combinations(self):
for combination in [ self.allOf, self.anyOf, self.oneOf ]:
if isinstance(combination, Combination):
for option in combination.options:
yield option
def property(self, key, return_definition=True):
# local properties
for prop in self.properties:
if prop.name == key:
return prop.definition if return_definition else prop
# collected/combinations properties
for candidate in self._combinations():
if isinstance(candidate, Reference):
candidate = candidate.resolve()
try:
return candidate.property(key, return_definition=return_definition)
except:
pass
raise KeyError("'{}' is not a known property".format(key))
def _select(self, name, *remainder, stack=None):
if stack is None: stack = []
log(stack, "object", name, remainder)
result = None
# TODO generalize this at schema level
if name == "components" and remainder[0] == "schemas":
try:
remainder = list(remainder)
stack.append("components")
stack.append(remainder.pop(0))
name = remainder.pop(0)
result = self.definition(name, return_definition=False)
stack.append(result)
if remainder:
result = result._select(*remainder, stack=stack)
except KeyError:
pass
else:
try:
result = self.property(name, return_definition=False)
stack.append(result)
if remainder:
result = result._select(*remainder, stack=stack)
except KeyError:
pass
return result
def _more_repr(self):
return {
"properties" : [ prop.name for prop in self.properties ],
"definitions" : [ definition.name for definition in self.definitions ],
# "allOf" : [ repr(candidate) for candidate in self.allOf.options ],
# "oneOf" : [ repr(candidate) for candidate in self.oneOf.options ],
# "anyOf" : [ repr(candidate) for candidate in self.anyOf.options ]
}
def to_dict(self, deref=False, prefix=None, stack=None):
if stack is None: stack = []
out = super().to_dict(deref=deref, prefix=prefix, stack=stack)
if self.properties:
out["properties"] = {
p.name : p.to_dict(deref=deref, prefix=prefix, stack=stack+["properties"]) for p in self.properties
}
if self.definitions:
out["definitions"] = {
d.name : d.to_dict(deref=deref, prefix=prefix, stack=stack+["definitions"]) for d in self.definitions
}
if self.allOf:
out["allOf"] = [
a.to_dict(deref=deref, prefix=prefix, stack=stack) for a in self.allOf.options
]
if self.oneOf:
out["oneOf"] = [
a.to_dict(deref=deref, prefix=prefix, stack=stack) for a in self.oneOf.options
]
if self.anyOf:
out["anyOf"] = [
a.to_dict(deref=deref, prefix=prefix, stack=stack) for a in self.anyOf.options
]
return out
def dependencies(self, external=False, visited=None):
return list({
dependency \
for prop in self.properties + list(self._combinations()) \
for dependency in prop.dependencies(external=external, visited=visited)
})
class Definition(IdentifiedSchema):
def __init__(self, name, definition):
self.name = name
self._definition = definition
if isinstance(self._definition, Schema):
self._definition.parent = self
self._location = self._definition._location
else:
raise ValueError("unsupported items type: '{}'".format(
self.items.__class__.__type__)
)
def is_ref(self):
return isinstance(self._definition, Reference)
@property
def definition(self):
d = self._definition
while isinstance(d, Reference):
d = d.resolve()
return d
def _more_repr(self):
return {
"name" : self.name,
"definition" : repr(self._definition)
}
def to_dict(self, deref=False, prefix=None, stack=None):
if stack is None: stack = []
if isinstance(self._definition, Schema):
return self._definition.to_dict(deref=deref, prefix=prefix, stack=stack + [self.name])
else:
return self._definition
def _select(self, *path, stack=None):
log(stack, "definition/property", path)
return self.definition._select(*path, stack=stack)
def dependencies(self, external=False, visited=None):
return self._definition.dependencies(external=external, visited=visited)
class Property(Definition): pass
class ValueSchema(IdentifiedSchema): pass
class StringSchema(ValueSchema): pass
class IntegerSchema(ValueSchema): pass
class NullSchema(ValueSchema): pass
class NumberSchema(ValueSchema): pass
class BooleanSchema(ValueSchema): pass
class ArraySchema(IdentifiedSchema):
def __init__(self, items=None, **kwargs):
super().__init__(**kwargs)
self.items = items
if isinstance(self.items, Schema):
self.items.parent = self
elif self.items is None:
self.items = []
else:
raise ValueError("unsupported items type: '{}'".format(
self.items.__class__.__name__)
)
def _more_repr(self):
return {
"items" : repr(self.items)
}
def to_dict(self, deref=False, prefix=None, stack=None):
if stack is None: stack = []
out = super().to_dict(deref=deref, prefix=prefix, stack=stack)
if isinstance(self.items, Schema):
out["items"] = self.items.to_dict(deref=deref, prefix=prefix, stack=stack+["items"])
else:
out["items"] = self.items
return out
def _select(self, index, *path, stack=None):
# TODO in case of (None)
log(stack, "array", index, path)
if isinstance(self.items, Schema):
return self.items._select(index, *path, stack=stack)
def dependencies(self, external=False, visited=None):
if isinstance(self.items, Schema):
return self.items.dependencies(external=external, visited=visited)
else:
return list({
dependency \
for item in self.items \
for dependency in item.dependencies(external=external, visited=visited)
})
class TupleItem(Definition):
def _more_repr(self):
return {
"index" : self.name,
"definition" : repr(self._definition)
}
class TupleSchema(IdentifiedSchema):
def __init__(self, items=None, **kwargs):
super().__init__(**kwargs)
self.items = items
if not isinstance(self.items, list):
raise ValueError("tuple items should be list, not: '{}'".format(
self.items.__class__.__name__)
)
for item in self.items:
item.parent = self
def _more_repr(self):
return {
"items" : repr(self.items)
}
def item(self, index):
return self[index].definition
def __getitem__(self, index):
if not isinstance(index, int):
raise TypeError("tuple access only with numeric indices")
return self.items[index]
def to_dict(self, deref=False, prefix=None, stack=None):
if stack is None: stack = []
out = super().to_dict(deref=deref, prefix=prefix, stack=stack)
out["items"] = [ item.to_dict(deref=deref, prefix=prefix, stack=stack) for item in self.items ]
return out
def _select(self, index, *path, stack=None):
log(stack, "tuple", index, path)
if path:
return self[int(index)]._select(*path, stack=stack)
else:
return self[int(index)]
def dependencies(self, external=False, visited=None):
return list({
dependency \
for item in self.items \
for dependency in item.dependencies(external=external, visited=visited)
})
class Combination(IdentifiedSchema):
def __init__(self, options=None, **kwargs):
super().__init__(**kwargs)
self.options = options if options else []
for option in self.options:
option.parent = self
def _more_repr(self):
return {
"options" : len(self.options)
}
def to_dict(self, deref=False, prefix=None, stack=None):
if stack is None: stack = []
out = super().to_dict(deref=deref, prefix=prefix, stack=stack)
name = self.__class__.__name__
name = name[0].lower() + name[1:]
out[name] = [
o.to_dict(deref=deref, prefix=prefix, stack=stack+[name]+[str(index)]) \
for index, o in enumerate(self.options)
]
return out
def _select(self, *path, stack=None):
log(stack, "combination", path)
best_stack = []
result = None
for option in self.options:
local_stack = []
result = option._select(*path, stack=local_stack)
if len(local_stack) > len(best_stack):
best_stack = local_stack
if result: break
stack.extend(local_stack)
return result
def dependencies(self, external=False, visited=None):
return list({
dependency \
for option in self.options \
for dependency in option.dependencies(external=external, visited=visited)
})
class AllOf(Combination): pass
class AnyOf(Combination): pass
class OneOf(Combination): pass
class Reference(IdentifiedSchema):
def __init__(self, ref=None, **kwargs):
super().__init__(**kwargs)
self.ref = ref.value
def __repr__(self):
return "Reference(ref={})".format( self.ref )
def _more_repr(self):
return {
"$ref" : self.ref
}
def to_dict(self, deref=False, prefix=None, stack=None):
if stack is None: stack = []
if prefix is None: prefix = "#"
if deref:
if self.is_remote:
prefix = "#/" + "/".join(stack)
return self.resolve(strip_id=True).to_dict(deref=deref, prefix=prefix, stack=stack)
else:
return { "$ref" : prefix + self.ref[1:] }
return { "$ref" : self.ref }
def resolve(self, return_definition=True, strip_id=False):
url = ""
fragment = ""
parts = self.ref.split("#")
if len(parts) == 1:
url = self.ref
else:
url = parts[0]
fragment = parts[1]
if url:
doc = self._fetch(url)
if strip_id:
try:
del doc.args["$id"]
except KeyError:
pass
else:
doc = self.root
if not fragment:
return doc
name = None
fragment_schema = None
if fragment.startswith("/definitions/"):
name = fragment.replace("/definitions/", "")
if not doc.definition:
raise ValueError("doc " + repr(doc) + " has no definitions ?!")
fragment_schema = doc.definition(name, return_definition=return_definition)
elif fragment.startswith("/properties/"):
name = fragment.replace("/properties/", "")
fragment_schema = doc.property(name, return_definition=return_definition)
elif fragment.startswith("/components/schemas/"):
name = fragment.replace("/components/schemas/", "")
fragment_schema = doc.definition(name, return_definition=return_definition)
else:
raise NotImplementedError
# FIXME: when refering to a non local fragment, the fragment can refer to
# something else in its own file. A partial solution here includes
# all other definitions. Refering to properties or the whole schema
# remains problematic.
if url and isinstance(fragment_schema, ObjectSchema) and doc.definition:
for definition in doc.definitions:
if definition.name != name:
fragment_schema.add_definition(Definition(definition.name, definition._definition))
return fragment_schema
def _fetch(self, url):
s = requests.Session()
s.mount("file:", FileAdapter())
# make sure file url is absolute
u = urlparse(url)
if u.scheme == "file":
u = u._replace(path=str(Path(u.path).absolute()))
url = u.geturl()
try:
doc = s.get(url)
except Exception as e:
raise ValueError("unable to fetch '{}', due to '{}'".format(url, str(e)))
src = doc.text
try:
return loads(src, origin=url)
except:
try:
return loads(src, parser=yaml)
except Exception as e:
print(src)
raise ValueError("unable to parse '{}', due to '{}'".format(url, str(e)))
def _select(self, *path, stack=None):
log(self._stack, "ref", path)
return self.resolve()._select(*path, stack=stack)
@property
def is_remote(self):
return not self.ref.startswith("#")
def dependencies(self, external=False, visited=None):
if not visited: visited = []
if self in visited:
return []
visited.append(self)
if self.is_remote:
if external:
return list(set( self.resolve(return_definition=False).dependencies(external=external, visited=visited) + [ self ] ))
else:
return [ self ]
else:
return list(set( self.resolve(return_definition=False).dependencies(external=external, visited=visited) ))
def __hash__(self):
return hash(self.ref)
def __eq__(self, other):
if isinstance(other, self.__class__):
return self.ref == other.ref
else:
return False
class Enum(IdentifiedSchema):
def __init__(self, enum=None, **kwargs):
super().__init__(**kwargs)
self.values = []
if enum:
for e in enum:
if not isinstance(e, ConstantValueSchema):
raise ValueError("not constant value", e)
else:
self.values.append(e.value)
def _more_repr(self):
return {
"enum" : self.values
}
def to_dict(self, deref=False, prefix=None, stack=None):
return { "enum" : self.values }
class SchemaMapper(Mapper):
def map_object(self, properties):
if self.has( properties, "type", "object" ) or \
self.has( properties, "type", list, containing="object") or \
( self.has(properties, "properties") and \
not isinstance(properties["properties"], IdentifiedSchema) ) or \
( self.has(properties, "components") and \
not isinstance(properties["components"], IdentifiedSchema) ):
# properties and definitions bubble up as Generic Schemas
if self.has(properties, "properties"):
properties["properties"] = [
Property(name, definition) \
for name, definition in properties["properties"].items()
]
if self.has(properties, "definitions"):
properties["definitions"] = [
Definition(name, definition) \
for name, definition in properties["definitions"].items()
]
if self.has(properties, "components") and properties["components"].schemas:
components = properties.pop("components")
if not "definitions" in properties: properties["definitions"] = []
properties["definitions"] += [
Definition(name, definition) \
for name, definition in components.schemas.items()
]
# extract combinations
for combination, cls in { "allOf" : AllOf, "oneOf" : OneOf, "anyOf": AnyOf }.items():
options = self._combine_options(properties, combination, combination.lower())
if options:
properties[combination] = cls(options=options)
return ObjectSchema(**properties)
def map_value(self, properties):
value_mapping = {
"boolean": BooleanSchema,
"integer": IntegerSchema,
"null": NullSchema,
"number": NumberSchema,
"string": StringSchema
}
if self.has(properties, "type", value_mapping):
return value_mapping[properties["type"].value](**properties)
def map_array(self, properties):
if not self.has(properties, "type", "array"): return
if self.has(properties, "items", list):
properties["items"] = [
TupleItem(index, value) \
for index, value in enumerate(properties["items"])
]
return TupleSchema(**properties)
return ArraySchema(**properties)
def _combine_options(self, properties, *keys):
combined = []
for key in keys:
if self.has(properties, key):
combined += properties.pop(key, {})
return combined
def map_all_of(self, properties):
if "type" in properties: return
options = self._combine_options(properties, "allOf", "allof")
if options:
properties["options"] = options
return AllOf(**properties)
def map_any_of(self, properties):
if "type" in properties: return
options = self._combine_options(properties, "anyOf", "anyof")
if options:
properties["options"] = options
return AnyOf(**properties)
def map_one_of(self, properties):
if "type" in properties: return
options = self._combine_options(properties, "oneOf", "oneof")
if options:
properties["options"] = options
return OneOf(**properties)
def map_reference(self, properties):
if self.has(properties, "$ref", str):
properties["ref"] = properties.pop("$ref")
return Reference(**properties)
def map_enum(self, properties):
if self.has(properties, "enum", list):
return Enum(**properties)
|
/schema_tools-0.0.19-py3-none-any.whl/schema_tools/schema/json.py
| 0.443841 | 0.180504 |
json.py
|
pypi
|
import functools
from copy import deepcopy
def CONSTANT(x):
''' Takes a value, returns a function that always returns that value
Useful inside schemas for defining constants
>>> CONSTANT(7)('my', 'name', verb='is')
7
>>> CONSTANT([123, 456])()
[123, 456]
'''
def inner(*y, **z):
return x
return inner
def compose(*functions):
''' evaluates functions from right to left.
>>> add = lambda x, y: x + y
>>> add3 = lambda x: x + 3
>>> divide2 = lambda x: x/2
>>> subtract4 = lambda x: x - 4
>>> subtract1 = compose(add3, subtract4)
>>> subtract1(1)
0
>>> compose(subtract1, add3)(4)
6
>>> compose(int, add3, add3, divide2)(4)
8
>>> compose(int, divide2, add3, add3)(4)
5
>>> compose(int, divide2, compose(add3, add3), add)(7, 3)
8
'''
def inner(func1, func2):
return lambda *x, **y: func1(func2(*x, **y))
return functools.reduce(inner, functions)
def updated_schema(old, new):
''' Creates a dictionary resulting from adding all keys/values of the second to the first
The second dictionary will overwrite the first.
>>> old, new = {'name': 'ric', 'job': None}, {'name': 'Rick'}
>>> updated = updated_schema(old, new)
>>> len(updated.keys())
2
>>> print(updated['name'])
Rick
>>> updated['job'] is None
True
'''
d = deepcopy(old)
for key, value in new.items():
if isinstance(value, dict) and old.get(key) and isinstance(old[key], dict):
d[key] = updated_schema(old[key], new[key])
else:
d[key] = value
return d
def single_result(l, default=''):
''' A function that will return the first element of a list if it exists
>>> print(single_result(['hello', None]))
hello
>>> print(single_result([], default='hello'))
hello
>>> print(single_result([]))
<BLANKLINE>
'''
return l[0] if l else default
|
/schema-transformer-0.0.2.tar.gz/schema-transformer-0.0.2/schema_transformer/helpers.py
| 0.732592 | 0.454654 |
helpers.py
|
pypi
|
from dataclasses import asdict, is_dataclass
from functools import wraps
from typing import (Any, Callable, Dict, Iterable, List, Optional, Union, cast)
from pydantic import BaseModel, ValidationError
from pydantic.dataclasses import is_builtin_dataclass
from flask import Response, current_app, g, jsonify, request
from werkzeug.datastructures import Headers
from werkzeug.exceptions import BadRequest
from schema_validator.constants import (
SCHEMA_QUERYSTRING_ATTRIBUTE, SCHEMA_REQUEST_ATTRIBUTE,
SCHEMA_RESPONSE_ATTRIBUTE, SCHEMA_TAG_ATTRIBUTE
)
from schema_validator.types import PydanticModel
from schema_validator.utils import DataSource, check_body_schema, \
check_query_string_schema, check_response_schema
def check_response(result, response_model: Dict[int, PydanticModel]):
status_or_headers: Union[None, int, str, Dict, List] = None
headers: Optional[Headers] = None
if isinstance(result, tuple):
value, status_or_headers, headers = result + (None,) * (
3 - len(result))
else:
value = result
if isinstance(value, Response):
value = value.get_json()
status = 200
if status_or_headers is not None and not isinstance(
status_or_headers, (Headers, dict, list)
) and str(status_or_headers).isdigit():
status = int(status_or_headers)
bad_status = BadRequest.code
for status_code, model_cls in response_model.items():
if status_code != status:
continue
if isinstance(value, dict):
try:
model_value = model_cls(**value)
except (TypeError, ValidationError) as ve:
return jsonify(validation_error=str(ve)), bad_status
elif type(value) == model_cls:
model_value = value
elif is_builtin_dataclass(value):
model_value = model_cls(**asdict(value))
else:
return jsonify(validation_error="invalid response"), bad_status
if is_dataclass(model_value):
return asdict(model_value), status_or_headers, headers
else:
model_value = cast(BaseModel, model_value)
return model_value.dict(), status_or_headers, headers
return result
def validate(
query_string: Optional[PydanticModel] = None,
body: Optional[PydanticModel] = None,
source: DataSource = DataSource.JSON,
validate_path_args: bool = False,
responses: Union[PydanticModel, Dict[int, PydanticModel], None] = None,
headers: Optional[PydanticModel] = None,
tags: Optional[Iterable[str]] = None
) -> Callable:
"""
params:
query_string:
the params in query
body:
json body or form
source:
the body source
response:
response model define
from dataclasses import dataclass
from datetime import datetime
from typing import Optional
from pydantic import BaseModel
from flask import Flask
from schema_validator import FlaskSchema, validate
app = Flask(__name__)
FlaskSchema(app)
OR
schema = FlaskSchema()
schema.init_app(app)
@dataclass
class Todo:
task: str
due: Optional[datetime]
class TodoResponse(BaseModel):
id: int
name: str
@app.post("/")
@validate(body=Todo, responses=TodoResponse)
def create_todo():
... # Do something with data, e.g. save to the DB
return dict(id=1, name="2")
@app.put("/")
@validate(
body=Todo,
responses={200: TodoResponse, 400: TodoResponse},
tags=["SOME-TAG"]
)
def update_todo():
... # Do something with data, e.g. save to the DB
return TodoResponse(id=1, name="123")
@tags("SOME-TAG", "OTHER-TAG")
class View(MethodView):
@validate(...)
def get(self):
return {}
"""
# TODO
if validate_path_args:
pass
# TODO
if headers is not None:
pass
if query_string is not None:
query_string = check_query_string_schema(query_string)
if body is not None:
body = check_body_schema(body, source)
if responses is not None:
responses = check_response_schema(responses)
def decorator(func: Callable) -> Callable:
if query_string:
setattr(func, SCHEMA_QUERYSTRING_ATTRIBUTE, query_string)
if body:
setattr(func, SCHEMA_REQUEST_ATTRIBUTE, (body, source))
if responses:
setattr(func, SCHEMA_RESPONSE_ATTRIBUTE, responses)
if tags:
setattr(func, SCHEMA_TAG_ATTRIBUTE, list(set(tags)))
@wraps(func)
def wrapper(*args: Any, **kwargs: Any) -> Any:
err = {}
if body:
if source == DataSource.JSON:
data = request.get_json()
else:
data = request.form
try:
body_model = body(**data)
except (TypeError, ValidationError) as ve:
err["body_params"] = str(ve)
else:
g.body_params = body_model
if query_string:
try:
query_params = query_string(**request.args)
except (TypeError, ValidationError) as ve:
err["query_params"] = str(ve)
else:
g.query_params = query_params
if err:
return jsonify(validation_error=err), BadRequest.code
result = current_app.ensure_sync(func)(*args, **kwargs)
if responses:
return check_response(result, responses)
return result
return wrapper
return decorator
|
/schema_validator-0.2.5.tar.gz/schema_validator-0.2.5/schema_validator/flask/validation.py
| 0.72662 | 0.152473 |
validation.py
|
pypi
|
from dataclasses import asdict, is_dataclass
from functools import wraps
from typing import (Any, Callable, Dict, Iterable, List, Optional, Union, cast)
from pydantic import BaseModel, ValidationError
from pydantic.dataclasses import is_builtin_dataclass
from quart import Response, current_app, g, jsonify, request
from werkzeug.datastructures import Headers
from werkzeug.exceptions import BadRequest
from schema_validator.constants import (
SCHEMA_QUERYSTRING_ATTRIBUTE, SCHEMA_REQUEST_ATTRIBUTE,
SCHEMA_RESPONSE_ATTRIBUTE, SCHEMA_TAG_ATTRIBUTE
)
from schema_validator.types import PydanticModel
from schema_validator.utils import DataSource, check_body_schema, \
check_query_string_schema, check_response_schema
async def check_response(result, response_model: Dict[int, PydanticModel]):
status_or_headers: Union[None, int, str, Dict, List] = None
headers: Optional[Headers] = None
if isinstance(result, tuple):
value, status_or_headers, headers = result + (None,) * (
3 - len(result))
else:
value = result
if isinstance(value, Response):
value = await value.get_json()
status = 200
if status_or_headers is not None and not isinstance(
status_or_headers, (Headers, dict, list)
) and str(status_or_headers).isdigit():
status = int(status_or_headers)
bad_status = BadRequest.code
for status_code, model_cls in response_model.items():
if status_code != status:
continue
if isinstance(value, dict):
try:
model_value = model_cls(**value)
except (TypeError, ValidationError) as ve:
return jsonify(validation_error=str(ve)), bad_status
elif type(value) == model_cls:
model_value = value
elif is_builtin_dataclass(value):
model_value = model_cls(**asdict(value))
else:
return jsonify(validation_error="invalid response"), bad_status
if is_dataclass(model_value):
return asdict(model_value), status_or_headers, headers
else:
model_value = cast(BaseModel, model_value)
return model_value.dict(), status_or_headers, headers
return result
def validate(
query_string: Optional[PydanticModel] = None,
body: Optional[PydanticModel] = None,
source: DataSource = DataSource.JSON,
validate_path_args: bool = False,
responses: Union[PydanticModel, Dict[int, PydanticModel], None] = None,
headers: Optional[PydanticModel] = None,
tags: Optional[Iterable[str]] = None
) -> Callable:
"""
params:
query_string:
the params in query
body:
json body or form
source:
the body source
response:
response model define
from dataclasses import dataclass
from datetime import datetime
from typing import Optional
from pydantic import BaseModel
from flask import Flask
from schema_validator import FlaskSchema, validate
app = Flask(__name__)
FlaskSchema(app)
OR
schema = FlaskSchema()
schema.init_app(app)
@dataclass
class Todo:
task: str
due: Optional[datetime]
class TodoResponse(BaseModel):
id: int
name: str
@app.post("/")
@validate(body=Todo, responses=TodoResponse)
def create_todo():
... # Do something with data, e.g. save to the DB
return dict(id=1, name="2")
@app.put("/")
@validate(
body=Todo,
responses={200: TodoResponse, 400: TodoResponse},
tags=["SOME-TAG"]
)
def update_todo():
... # Do something with data, e.g. save to the DB
return TodoResponse(id=1, name="123")
@tags("SOME-TAG", "OTHER-TAG")
class View(MethodView):
@validate(...)
def get(self):
return {}
"""
# TODO
if validate_path_args:
pass
# TODO
if headers is not None:
pass
if query_string is not None:
query_string = check_query_string_schema(query_string)
if body is not None:
body = check_body_schema(body, source)
if responses is not None:
responses = check_response_schema(responses)
def decorator(func: Callable) -> Callable:
if query_string:
setattr(func, SCHEMA_QUERYSTRING_ATTRIBUTE, query_string)
if body:
setattr(func, SCHEMA_REQUEST_ATTRIBUTE, (body, source))
if responses:
setattr(func, SCHEMA_RESPONSE_ATTRIBUTE, responses)
if tags:
setattr(func, SCHEMA_TAG_ATTRIBUTE, list(set(tags)))
@wraps(func)
async def wrapper(*args: Any, **kwargs: Any) -> Any:
err = {}
if body:
if source == DataSource.JSON:
data = await request.get_json()
else:
data = await request.form
try:
body_model = body(**data)
except (TypeError, ValidationError) as ve:
err["body_params"] = str(ve)
else:
g.body_params = body_model
if query_string:
try:
query_params = query_string(**request.args)
except (TypeError, ValidationError) as ve:
err["query_params"] = str(ve)
else:
g.query_params = query_params
if err:
return jsonify(validation_error=err), BadRequest.code
result = await current_app.ensure_async(func)(*args, **kwargs)
if responses:
return await check_response(result, responses)
return result
return wrapper
return decorator
|
/schema_validator-0.2.5.tar.gz/schema_validator-0.2.5/schema_validator/quart/validation.py
| 0.732209 | 0.157266 |
validation.py
|
pypi
|
Schema validation just got Pythonic
===============================================================================
**schema** is a library for validating Python data structures, such as those
obtained from config-files, forms, external services or command-line
parsing, converted from JSON/YAML (or something else) to Python data-types.
.. image:: https://secure.travis-ci.org/keleshev/schema.svg?branch=master
:target: https://travis-ci.org/keleshev/schema
.. image:: https://img.shields.io/codecov/c/github/keleshev/schema.svg
:target: http://codecov.io/github/keleshev/schema
Example
----------------------------------------------------------------------------
Here is a quick example to get a feeling of **schema**, validating a list of
entries with personal information:
.. code:: python
>>> from schema import Schema, And, Use, Optional, SchemaError
>>> schema = Schema([{'name': And(str, len),
... 'age': And(Use(int), lambda n: 18 <= n <= 99),
... Optional('gender'): And(str, Use(str.lower),
... lambda s: s in ('squid', 'kid'))}])
>>> data = [{'name': 'Sue', 'age': '28', 'gender': 'Squid'},
... {'name': 'Sam', 'age': '42'},
... {'name': 'Sacha', 'age': '20', 'gender': 'KID'}]
>>> validated = schema.validate(data)
>>> assert validated == [{'name': 'Sue', 'age': 28, 'gender': 'squid'},
... {'name': 'Sam', 'age': 42},
... {'name': 'Sacha', 'age' : 20, 'gender': 'kid'}]
If data is valid, ``Schema.validate`` will return the validated data
(optionally converted with `Use` calls, see below).
If data is invalid, ``Schema`` will raise ``SchemaError`` exception.
If you just want to check that the data is valid, ``schema.is_valid(data)`` will
return ``True`` or ``False``.
Installation
-------------------------------------------------------------------------------
Use `pip <http://pip-installer.org>`_ or easy_install::
pip install schema
Alternatively, you can just drop ``schema.py`` file into your project—it is
self-contained.
- **schema** is tested with Python 2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9 and PyPy.
- **schema** follows `semantic versioning <http://semver.org>`_.
How ``Schema`` validates data
-------------------------------------------------------------------------------
Types
~~~~~
If ``Schema(...)`` encounters a type (such as ``int``, ``str``, ``object``,
etc.), it will check if the corresponding piece of data is an instance of that type,
otherwise it will raise ``SchemaError``.
.. code:: python
>>> from schema import Schema
>>> Schema(int).validate(123)
123
>>> Schema(int).validate('123')
Traceback (most recent call last):
...
schema.SchemaUnexpectedTypeError: '123' should be instance of 'int'
>>> Schema(object).validate('hai')
'hai'
Callables
~~~~~~~~~
If ``Schema(...)`` encounters a callable (function, class, or object with
``__call__`` method) it will call it, and if its return value evaluates to
``True`` it will continue validating, else—it will raise ``SchemaError``.
.. code:: python
>>> import os
>>> Schema(os.path.exists).validate('./')
'./'
>>> Schema(os.path.exists).validate('./non-existent/')
Traceback (most recent call last):
...
schema.SchemaError: exists('./non-existent/') should evaluate to True
>>> Schema(lambda n: n > 0).validate(123)
123
>>> Schema(lambda n: n > 0).validate(-12)
Traceback (most recent call last):
...
schema.SchemaError: <lambda>(-12) should evaluate to True
"Validatables"
~~~~~~~~~~~~~~
If ``Schema(...)`` encounters an object with method ``validate`` it will run
this method on corresponding data as ``data = obj.validate(data)``. This method
may raise ``SchemaError`` exception, which will tell ``Schema`` that that piece
of data is invalid, otherwise—it will continue validating.
An example of "validatable" is ``Regex``, that tries to match a string or a
buffer with the given regular expression (itself as a string, buffer or
compiled regex ``SRE_Pattern``):
.. code:: python
>>> from schema import Regex
>>> import re
>>> Regex(r'^foo').validate('foobar')
'foobar'
>>> Regex(r'^[A-Z]+$', flags=re.I).validate('those-dashes-dont-match')
Traceback (most recent call last):
...
schema.SchemaError: Regex('^[A-Z]+$', flags=re.IGNORECASE) does not match 'those-dashes-dont-match'
For a more general case, you can use ``Use`` for creating such objects.
``Use`` helps to use a function or type to convert a value while validating it:
.. code:: python
>>> from schema import Use
>>> Schema(Use(int)).validate('123')
123
>>> Schema(Use(lambda f: open(f, 'a'))).validate('LICENSE-MIT')
<_io.TextIOWrapper name='LICENSE-MIT' mode='a' encoding='UTF-8'>
Dropping the details, ``Use`` is basically:
.. code:: python
class Use(object):
def __init__(self, callable_):
self._callable = callable_
def validate(self, data):
try:
return self._callable(data)
except Exception as e:
raise SchemaError('%r raised %r' % (self._callable.__name__, e))
Sometimes you need to transform and validate part of data, but keep original data unchanged.
``Const`` helps to keep your data safe:
.. code:: python
>> from schema import Use, Const, And, Schema
>> from datetime import datetime
>> is_future = lambda date: datetime.now() > date
>> to_json = lambda v: {"timestamp": v}
>> Schema(And(Const(And(Use(datetime.fromtimestamp), is_future)), Use(to_json))).validate(1234567890)
{"timestamp": 1234567890}
Now you can write your own validation-aware classes and data types.
Lists, similar containers
~~~~~~~~~~~~~~~~~~~~~~~~~
If ``Schema(...)`` encounters an instance of ``list``, ``tuple``, ``set``
or ``frozenset``, it will validate contents of corresponding data container
against all schemas listed inside that container and aggregate all errors:
.. code:: python
>>> Schema([1, 0]).validate([1, 1, 0, 1])
[1, 1, 0, 1]
>>> Schema((int, float)).validate((5, 7, 8, 'not int or float here'))
Traceback (most recent call last):
...
schema.SchemaError: Or(<class 'int'>, <class 'float'>) did not validate 'not int or float here'
'not int or float here' should be instance of 'int'
'not int or float here' should be instance of 'float'
Dictionaries
~~~~~~~~~~~~
If ``Schema(...)`` encounters an instance of ``dict``, it will validate data
key-value pairs:
.. code:: python
>>> d = Schema({'name': str,
... 'age': lambda n: 18 <= n <= 99}).validate({'name': 'Sue', 'age': 28})
>>> assert d == {'name': 'Sue', 'age': 28}
You can specify keys as schemas too:
.. code:: python
>>> schema = Schema({str: int, # string keys should have integer values
... int: None}) # int keys should be always None
>>> data = schema.validate({'key1': 1, 'key2': 2,
... 10: None, 20: None})
>>> schema.validate({'key1': 1,
... 10: 'not None here'})
Traceback (most recent call last):
...
schema.SchemaError: Key '10' error:
None does not match 'not None here'
This is useful if you want to check certain key-values, but don't care
about others:
.. code:: python
>>> schema = Schema({'<id>': int,
... '<file>': Use(open),
... str: object}) # don't care about other str keys
>>> data = schema.validate({'<id>': 10,
... '<file>': 'README.rst',
... '--verbose': True})
You can mark a key as optional as follows:
.. code:: python
>>> from schema import Optional
>>> Schema({'name': str,
... Optional('occupation'): str}).validate({'name': 'Sam'})
{'name': 'Sam'}
``Optional`` keys can also carry a ``default``, to be used when no key in the
data matches:
.. code:: python
>>> from schema import Optional
>>> Schema({Optional('color', default='blue'): str,
... str: str}).validate({'texture': 'furry'}
... ) == {'color': 'blue', 'texture': 'furry'}
True
Defaults are used verbatim, not passed through any validators specified in the
value.
default can also be a callable:
.. code:: python
>>> from schema import Schema, Optional
>>> Schema({Optional('data', default=dict): {}}).validate({}) == {'data': {}}
True
Also, a caveat: If you specify types, **schema** won't validate the empty dict:
.. code:: python
>>> Schema({int:int}).is_valid({})
False
To do that, you need ``Schema(Or({int:int}, {}))``. This is unlike what happens with
lists, where ``Schema([int]).is_valid([])`` will return True.
**schema** has classes ``And`` and ``Or`` that help validating several schemas
for the same data:
.. code:: python
>>> from schema import And, Or
>>> Schema({'age': And(int, lambda n: 0 < n < 99)}).validate({'age': 7})
{'age': 7}
>>> Schema({'password': And(str, lambda s: len(s) > 6)}).validate({'password': 'hai'})
Traceback (most recent call last):
...
schema.SchemaError: Key 'password' error:
<lambda>('hai') should evaluate to True
>>> Schema(And(Or(int, float), lambda x: x > 0)).validate(3.1415)
3.1415
In a dictionary, you can also combine two keys in a "one or the other" manner. To do
so, use the `Or` class as a key:
.. code:: python
>>> from schema import Or, Schema
>>> schema = Schema({
... Or("key1", "key2", only_one=True): str
... })
>>> schema.validate({"key1": "test"}) # Ok
{'key1': 'test'}
>>> schema.validate({"key1": "test", "key2": "test"}) # SchemaError
Traceback (most recent call last):
...
schema.SchemaOnlyOneAllowedError: There are multiple keys present from the Or('key1', 'key2') condition
Hooks
~~~~~~~~~~
You can define hooks which are functions that are executed whenever a valid key:value is found.
The `Forbidden` class is an example of this.
You can mark a key as forbidden as follows:
.. code:: python
>>> from schema import Forbidden
>>> Schema({Forbidden('age'): object}).validate({'age': 50})
Traceback (most recent call last):
...
schema.SchemaForbiddenKeyError: Forbidden key encountered: 'age' in {'age': 50}
A few things are worth noting. First, the value paired with the forbidden
key determines whether it will be rejected:
.. code:: python
>>> Schema({Forbidden('age'): str, 'age': int}).validate({'age': 50})
{'age': 50}
Note: if we hadn't supplied the 'age' key here, the call would have failed too, but with
SchemaWrongKeyError, not SchemaForbiddenKeyError.
Second, Forbidden has a higher priority than standard keys, and consequently than Optional.
This means we can do that:
.. code:: python
>>> Schema({Forbidden('age'): object, Optional(str): object}).validate({'age': 50})
Traceback (most recent call last):
...
schema.SchemaForbiddenKeyError: Forbidden key encountered: 'age' in {'age': 50}
You can also define your own hooks. The following hook will call `_my_function` if `key` is encountered.
.. code:: python
from schema import Hook
def _my_function(key, scope, error):
print(key, scope, error)
Hook("key", handler=_my_function)
Here's an example where a `Deprecated` class is added to log warnings whenever a key is encountered:
.. code:: python
from schema import Hook, Schema
class Deprecated(Hook):
def __init__(self, *args, **kwargs):
kwargs["handler"] = lambda key, *args: logging.warn(f"`{key}` is deprecated. " + (self._error or ""))
super(Deprecated, self).__init__(*args, **kwargs)
Schema({Deprecated("test", "custom error message."): object}, ignore_extra_keys=True).validate({"test": "value"})
...
WARNING: `test` is deprecated. custom error message.
Extra Keys
~~~~~~~~~~
The ``Schema(...)`` parameter ``ignore_extra_keys`` causes validation to ignore extra keys in a dictionary, and also to not return them after validating.
.. code:: python
>>> schema = Schema({'name': str}, ignore_extra_keys=True)
>>> schema.validate({'name': 'Sam', 'age': '42'})
{'name': 'Sam'}
If you would like any extra keys returned, use ``object: object`` as one of the key/value pairs, which will match any key and any value.
Otherwise, extra keys will raise a ``SchemaError``.
Customized Validation
~~~~~~~~~~~~~~~~~~~~~~~
The ``Schema.validate`` method accepts additional keyword arguments. The
keyword arguments will be propagated to the ``validate`` method of any
child validatables (including any ad-hoc ``Schema`` objects), or the default
value callable (if a callable is specified) for ``Optional`` keys.
This feature can be used together with inheritance of the ``Schema`` class
for customized validation.
Here is an example where a "post-validation" hook that runs after validation
against a sub-schema in a larger schema:
.. code:: python
class EventSchema(schema.Schema):
def validate(self, data, _is_event_schema=True):
data = super(EventSchema, self).validate(data, _is_event_schema=False)
if _is_event_schema and data.get("minimum", None) is None:
data["minimum"] = data["capacity"]
return data
events_schema = schema.Schema(
{
str: EventSchema({
"capacity": int,
schema.Optional("minimum"): int, # default to capacity
})
}
)
data = {'event1': {'capacity': 1}, 'event2': {'capacity': 2, 'minimum': 3}}
events = events_schema.validate(data)
assert events['event1']['minimum'] == 1 # == capacity
assert events['event2']['minimum'] == 3
Note that the additional keyword argument ``_is_event_schema`` is necessary to
limit the customized behavior to the ``EventSchema`` object itself so that it
won't affect any recursive invoke of the ``self.__class__.validate`` for the
child schemas (e.g., the call to ``Schema("capacity").validate("capacity")``).
User-friendly error reporting
-------------------------------------------------------------------------------
You can pass a keyword argument ``error`` to any of validatable classes
(such as ``Schema``, ``And``, ``Or``, ``Regex``, ``Use``) to report this error
instead of a built-in one.
.. code:: python
>>> Schema(Use(int, error='Invalid year')).validate('XVII')
Traceback (most recent call last):
...
schema.SchemaError: Invalid year
You can see all errors that occurred by accessing exception's ``exc.autos``
for auto-generated error messages, and ``exc.errors`` for errors
which had ``error`` text passed to them.
You can exit with ``sys.exit(exc.code)`` if you want to show the messages
to the user without traceback. ``error`` messages are given precedence in that
case.
A JSON API example
-------------------------------------------------------------------------------
Here is a quick example: validation of
`create a gist <http://developer.github.com/v3/gists/>`_
request from github API.
.. code:: python
>>> gist = '''{"description": "the description for this gist",
... "public": true,
... "files": {
... "file1.txt": {"content": "String file contents"},
... "other.txt": {"content": "Another file contents"}}}'''
>>> from schema import Schema, And, Use, Optional
>>> import json
>>> gist_schema = Schema(And(Use(json.loads), # first convert from JSON
... # use str since json returns unicode
... {Optional('description'): str,
... 'public': bool,
... 'files': {str: {'content': str}}}))
>>> gist = gist_schema.validate(gist)
# gist:
{u'description': u'the description for this gist',
u'files': {u'file1.txt': {u'content': u'String file contents'},
u'other.txt': {u'content': u'Another file contents'}},
u'public': True}
Using **schema** with `docopt <http://github.com/docopt/docopt>`_
-------------------------------------------------------------------------------
Assume you are using **docopt** with the following usage-pattern:
Usage: my_program.py [--count=N] <path> <files>...
and you would like to validate that ``<files>`` are readable, and that
``<path>`` exists, and that ``--count`` is either integer from 0 to 5, or
``None``.
Assuming **docopt** returns the following dict:
.. code:: python
>>> args = {'<files>': ['LICENSE-MIT', 'setup.py'],
... '<path>': '../',
... '--count': '3'}
this is how you validate it using ``schema``:
.. code:: python
>>> from schema import Schema, And, Or, Use
>>> import os
>>> s = Schema({'<files>': [Use(open)],
... '<path>': os.path.exists,
... '--count': Or(None, And(Use(int), lambda n: 0 < n < 5))})
>>> args = s.validate(args)
>>> args['<files>']
[<_io.TextIOWrapper name='LICENSE-MIT' ...>, <_io.TextIOWrapper name='setup.py' ...]
>>> args['<path>']
'../'
>>> args['--count']
3
As you can see, **schema** validated data successfully, opened files and
converted ``'3'`` to ``int``.
JSON schema
-----------
You can also generate standard `draft-07 JSON schema <https://json-schema.org/>`_ from a dict ``Schema``.
This can be used to add word completion, validation, and documentation directly in code editors.
The output schema can also be used with JSON schema compatible libraries.
JSON: Generating
~~~~~~~~~~~~~~~~
Just define your schema normally and call ``.json_schema()`` on it. The output is a Python dict, you need to dump it to JSON.
.. code:: python
>>> from schema import Optional, Schema
>>> import json
>>> s = Schema({"test": str,
... "nested": {Optional("other"): str}
... })
>>> json_schema = json.dumps(s.json_schema("https://example.com/my-schema.json"))
# json_schema
{
"type":"object",
"properties": {
"test": {"type": "string"},
"nested": {
"type":"object",
"properties": {
"other": {"type": "string"}
},
"required": [],
"additionalProperties": false
}
},
"required":[
"test",
"nested"
],
"additionalProperties":false,
"$id":"https://example.com/my-schema.json",
"$schema":"http://json-schema.org/draft-07/schema#"
}
You can add descriptions for the schema elements using the ``Literal`` object instead of a string. The main schema can also have a description.
These will appear in IDEs to help your users write a configuration.
.. code:: python
>>> from schema import Literal, Schema
>>> import json
>>> s = Schema({Literal("project_name", description="Names must be unique"): str}, description="Project schema")
>>> json_schema = json.dumps(s.json_schema("https://example.com/my-schema.json"), indent=4)
# json_schema
{
"type": "object",
"properties": {
"project_name": {
"description": "Names must be unique",
"type": "string"
}
},
"required": [
"project_name"
],
"additionalProperties": false,
"$id": "https://example.com/my-schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "Project schema"
}
JSON: Supported validations
~~~~~~~~~~~~~~~~~~~~~~~~~~~
The resulting JSON schema is not guaranteed to accept the same objects as the library would accept, since some validations are not implemented or
have no JSON schema equivalent. This is the case of the ``Use`` and ``Hook`` objects for example.
Implemented
'''''''''''
`Object properties <https://json-schema.org/understanding-json-schema/reference/object.html#properties>`_
Use a dict literal. The dict keys are the JSON schema properties.
Example:
``Schema({"test": str})``
becomes
``{'type': 'object', 'properties': {'test': {'type': 'string'}}, 'required': ['test'], 'additionalProperties': False}``.
Please note that attributes are required by default. To create optional attributes use ``Optional``, like so:
``Schema({Optional("test"): str})``
becomes
``{'type': 'object', 'properties': {'test': {'type': 'string'}}, 'required': [], 'additionalProperties': False}``
additionalProperties is set to true when at least one of the conditions is met:
- ignore_extra_keys is True
- at least one key is `str` or `object`
For example:
``Schema({str: str})`` and ``Schema({}, ignore_extra_keys=True)``
both becomes
``{'type': 'object', 'properties' : {}, 'required': [], 'additionalProperties': True}``
and
``Schema({})``
becomes
``{'type': 'object', 'properties' : {}, 'required': [], 'additionalProperties': False}``
Types
Use the Python type name directly. It will be converted to the JSON name:
- ``str`` -> `string <https://json-schema.org/understanding-json-schema/reference/string.html>`_
- ``int`` -> `integer <https://json-schema.org/understanding-json-schema/reference/numeric.html#integer>`_
- ``float`` -> `number <https://json-schema.org/understanding-json-schema/reference/numeric.html#number>`_
- ``bool`` -> `boolean <https://json-schema.org/understanding-json-schema/reference/boolean.html>`_
- ``list`` -> `array <https://json-schema.org/understanding-json-schema/reference/array.html>`_
- ``dict`` -> `object <https://json-schema.org/understanding-json-schema/reference/object.html>`_
Example:
``Schema(float)``
becomes
``{"type": "number"}``
`Array items <https://json-schema.org/understanding-json-schema/reference/array.html#items>`_
Surround a schema with ``[]``.
Example:
``Schema([str])`` means an array of string and becomes:
``{'type': 'array', 'items': {'type': 'string'}}``
`Enumerated values <https://json-schema.org/understanding-json-schema/reference/generic.html#enumerated-values>`_
Use `Or`.
Example:
``Schema(Or(1, 2, 3))`` becomes
``{"enum": [1, 2, 3]}``
`Constant values <https://json-schema.org/understanding-json-schema/reference/generic.html#constant-values>`_
Use the value itself.
Example:
``Schema("name")`` becomes
``{"const": "name"}``
`Regular expressions <https://json-schema.org/understanding-json-schema/reference/regular_expressions.html>`_
Use ``Regex``.
Example:
``Schema(Regex("^v\d+"))`` becomes
``{'type': 'string', 'pattern': '^v\\d+'}``
`Annotations (title and description) <https://json-schema.org/understanding-json-schema/reference/generic.html#annotations>`_
You can use the ``name`` and ``description`` parameters of the ``Schema`` object init method.
To add description to keys, replace a str with a ``Literal`` object.
Example:
``Schema({Literal("test", description="A description"): str})``
is equivalent to
``Schema({"test": str})``
with the description added to the resulting JSON schema.
`Combining schemas with allOf <https://json-schema.org/understanding-json-schema/reference/combining.html#allof>`_
Use ``And``
Example:
``Schema(And(str, "value"))``
becomes
``{"allOf": [{"type": "string"}, {"const": "value"}]}``
Note that this example is not really useful in the real world, since ``const`` already implies the type.
`Combining schemas with anyOf <https://json-schema.org/understanding-json-schema/reference/combining.html#anyof>`_
Use ``Or``
Example:
``Schema(Or(str, int))``
becomes
``{"anyOf": [{"type": "string"}, {"type": "integer"}]}``
Not implemented
'''''''''''''''
The following JSON schema validations cannot be generated from this library.
- `String length <https://json-schema.org/understanding-json-schema/reference/string.html#length>`_
However, those can be implemented using ``Regex``
- `String format <https://json-schema.org/understanding-json-schema/reference/string.html#format>`_
However, those can be implemented using ``Regex``
- `Object dependencies <https://json-schema.org/understanding-json-schema/reference/object.html#dependencies>`_
- `Array length <https://json-schema.org/understanding-json-schema/reference/array.html#length>`_
- `Array uniqueness <https://json-schema.org/understanding-json-schema/reference/array.html#uniqueness>`_
- `Numeric multiples <https://json-schema.org/understanding-json-schema/reference/numeric.html#multiples>`_
- `Numeric ranges <https://json-schema.org/understanding-json-schema/reference/numeric.html#range>`_
- `Property Names <https://json-schema.org/understanding-json-schema/reference/object.html#property-names>`_
Not implemented. We suggest listing the possible keys instead. As a tip, you can use ``Or`` as a dict key.
Example:
``Schema({Or("name1", "name2"): str})``
- `Annotations (default and examples) <https://json-schema.org/understanding-json-schema/reference/generic.html#annotations>`_
- `Combining schemas with oneOf <https://json-schema.org/understanding-json-schema/reference/combining.html#oneof>`_
- `Not <https://json-schema.org/understanding-json-schema/reference/combining.html#not>`_
- `Object size <https://json-schema.org/understanding-json-schema/reference/object.html#size>`_
- `additionalProperties having a different schema (true and false is supported)`
JSON: Minimizing output size
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Explicit Reuse
''''''''''''''
If your JSON schema is big and has a lot of repetition, it can be made simpler and smaller by defining Schema objects as reference.
These references will be placed in a "definitions" section in the main schema.
`You can look at the JSON schema documentation for more information <https://json-schema.org/understanding-json-schema/structuring.html#reuse>`_
.. code:: python
>>> from schema import Optional, Schema
>>> import json
>>> s = Schema({"test": str,
... "nested": Schema({Optional("other"): str}, name="nested", as_reference=True)
... })
>>> json_schema = json.dumps(s.json_schema("https://example.com/my-schema.json"), indent=4)
# json_schema
{
"type": "object",
"properties": {
"test": {
"type": "string"
},
"nested": {
"$ref": "#/definitions/nested"
}
},
"required": [
"test",
"nested"
],
"additionalProperties": false,
"$id": "https://example.com/my-schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"nested": {
"type": "object",
"properties": {
"other": {
"type": "string"
}
},
"required": [],
"additionalProperties": false
}
}
}
This becomes really useful when using the same object several times
.. code:: python
>>> from schema import Optional, Or, Schema
>>> import json
>>> language_configuration = Schema({"autocomplete": bool, "stop_words": [str]}, name="language", as_reference=True)
>>> s = Schema({Or("ar", "cs", "de", "el", "eu", "en", "es", "fr"): language_configuration})
>>> json_schema = json.dumps(s.json_schema("https://example.com/my-schema.json"), indent=4)
# json_schema
{
"type": "object",
"properties": {
"ar": {
"$ref": "#/definitions/language"
},
"cs": {
"$ref": "#/definitions/language"
},
"de": {
"$ref": "#/definitions/language"
},
"el": {
"$ref": "#/definitions/language"
},
"eu": {
"$ref": "#/definitions/language"
},
"en": {
"$ref": "#/definitions/language"
},
"es": {
"$ref": "#/definitions/language"
},
"fr": {
"$ref": "#/definitions/language"
}
},
"required": [],
"additionalProperties": false,
"$id": "https://example.com/my-schema.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"language": {
"type": "object",
"properties": {
"autocomplete": {
"type": "boolean"
},
"stop_words": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"autocomplete",
"stop_words"
],
"additionalProperties": false
}
}
}
Automatic reuse
'''''''''''''''
If you want to minimize the output size without using names explicitly, you can have the library generate hashes of parts of the output JSON
schema and use them as references throughout.
Enable this behaviour by providing the parameter ``use_refs`` to the json_schema method.
Be aware that this method is less often compatible with IDEs and JSON schema libraries.
It produces a JSON schema that is more difficult to read by humans.
.. code:: python
>>> from schema import Optional, Or, Schema
>>> import json
>>> language_configuration = Schema({"autocomplete": bool, "stop_words": [str]})
>>> s = Schema({Or("ar", "cs", "de", "el", "eu", "en", "es", "fr"): language_configuration})
>>> json_schema = json.dumps(s.json_schema("https://example.com/my-schema.json", use_refs=True), indent=4)
# json_schema
{
"type": "object",
"properties": {
"ar": {
"type": "object",
"properties": {
"autocomplete": {
"type": "boolean",
"$id": "#6456104181059880193"
},
"stop_words": {
"type": "array",
"items": {
"type": "string",
"$id": "#1856069563381977338"
}
}
},
"required": [
"autocomplete",
"stop_words"
],
"additionalProperties": false
},
"cs": {
"type": "object",
"properties": {
"autocomplete": {
"$ref": "#6456104181059880193"
},
"stop_words": {
"type": "array",
"items": {
"$ref": "#1856069563381977338"
},
"$id": "#-5377945144312515805"
}
},
"required": [
"autocomplete",
"stop_words"
],
"additionalProperties": false
},
"de": {
"type": "object",
"properties": {
"autocomplete": {
"$ref": "#6456104181059880193"
},
"stop_words": {
"$ref": "#-5377945144312515805"
}
},
"required": [
"autocomplete",
"stop_words"
],
"additionalProperties": false,
"$id": "#-8142886105174600858"
},
"el": {
"$ref": "#-8142886105174600858"
},
"eu": {
"$ref": "#-8142886105174600858"
},
"en": {
"$ref": "#-8142886105174600858"
},
"es": {
"$ref": "#-8142886105174600858"
},
"fr": {
"$ref": "#-8142886105174600858"
}
},
"required": [],
"additionalProperties": false,
"$id": "https://example.com/my-schema.json",
"$schema": "http://json-schema.org/draft-07/schema#"
}
|
/schema-0.7.5.tar.gz/schema-0.7.5/README.rst
| 0.928547 | 0.667039 |
README.rst
|
pypi
|
.. image:: https://img.shields.io/pypi/v/schemadict.svg?style=flat
:target: https://pypi.org/project/schemadict/
:alt: Latest PyPI version
.. image:: https://readthedocs.org/projects/schemadict/badge/?version=latest
:target: https://schemadict.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://img.shields.io/badge/license-Apache%202-blue.svg
:target: https://github.com/airinnova/schemadict/blob/master/LICENSE.txt
:alt: License
.. image:: https://travis-ci.org/airinnova/schemadict.svg?branch=master
:target: https://travis-ci.org/airinnova/schemadict
:alt: Build status
.. image:: https://codecov.io/gh/airinnova/schemadict/branch/master/graph/badge.svg
:target: https://codecov.io/gh/airinnova/schemadict
:alt: Coverage
|
.. image:: https://raw.githubusercontent.com/airinnova/schemadict/master/docs/source/_static/images/logo.png
:target: https://github.com/airinnova/schemadict/
:alt: logo
A *schemadict* is a regular Python dictionary which specifies the type and format of values for some given key. To check if a test dictionary is conform with the expected schema, *schemadict* provides the `validate()` method. If the test dictionary is ill-defined, an error will be thrown, otherwise `None` is returned.
Examples
========
**Basic usage**
.. code:: python
>>> from schemadict import schemadict
>>> schema = schemadict({
... 'name': {
... 'type': str,
... 'min_len': 3,
... 'max_len': 12,
... },
... 'age': {
... 'type': int,
... '>=': 0,
... '<': 150,
... },
... })
>>>
>>> testdict = {'name': 'Neil', 'age': 55}
>>> schema.validate(testdict)
>>>
>>> testdict = {'name': 'Neil', 'age': -12}
>>> schema.validate(testdict)
Traceback (most recent call last):
...
ValueError: 'age' too small: expected >= 0, but was -12
>>>
>>> testdict = {'name': 'Neil', 'age': '55'}
>>> schema.validate(testdict)
Traceback (most recent call last):
...
TypeError: unexpected type for 'age': expected <class 'int'>, but was <class 'str'>
>>>
**Nested schemadict**
It is possible to check individual item in a list. For instance, in the following example we check if each item (of type ``str``) looks like a valid IPv4 address. How each item should look like can be specified with the ``item_schema`` keyword.
.. code:: python
>>> schema = schemadict({
... 'ip_addrs': {
... 'type': list,
... 'item_schema': {
... 'type': str,
... 'regex': r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$',
... },
... },
... })
>>>
>>>
>>> schema.validate({'ip_addrs': ['127.0.0.1', '192.168.1.1']}) # Valid
>>> schema.validate({'ip_addrs': ['127.0.0.1', '192.168.1.1', '1234.5678']}) # Last item invalid
Traceback (most recent call last):
...
ValueError: regex mismatch for 'ip_addrs': expected pattern '^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$', got '1234.5678'
>>>
Items in a ``list`` (or ``tuple``) may themselves be dictionaries which can be described with *schemadicts*. In this case, we use the keyword ``item_schemadict`` as illustrated in the following example.
.. code:: python
>>> schema_city = schemadict({
... 'name': {
... 'type': str
... },
... 'population': {
... 'type': int,
... '>=': 0,
... },
... })
>>>
>>> schema_country = schemadict({
... 'name': {'type': str},
... 'cities': {
... 'type': list,
... 'item_type': dict,
... 'item_schemadict': schema_city,
... },
... })
>>>
>>> test_country = {
... 'name': 'Neverland',
... 'cities': [
... {'name': 'Faketown', 'population': 3},
... {'name': 'Evergreen', 'population': True},
... ],
... }
>>>
>>> schema_country.validate(test_country)
Traceback (most recent call last):
...
TypeError: unexpected type for 'population': expected <class 'int'>, but was <class 'bool'>
>>>
**Custom validation functions**
Each *type* (``int``, ``bool``, ``str``, etc.) defines its own set of validation keywords and corresponding test functions. The dictionary ``STANDARD_VALIDATORS`` provided by the ``schemadict`` module contains the default validation functions for the Python's built-in types. However, it is also possible to modify or extend this dictionary with custom validation functions.
.. code:: python
>>> from schemadict import schemadict, STANDARD_VALIDATORS
>>> # Add a custom validation function
>>> def is_divisible(key, value, comp_value, _):
... if value % comp_value != 0:
... raise ValueError(f"{key!r} is not divisible by {comp_value}")
...
...
...
>>>
>>> # Update the standard validator dictionary
>>> my_validators = STANDARD_VALIDATORS
>>> my_validators[int]['%'] = is_divisible
>>> # Register the updated validator dictionary in the new schemadict instance
>>> s = schemadict({'my_num': {'type': int, '%': 3}}, validators=my_validators)
>>> s.validate({'my_num': 33})
>>> s.validate({'my_num': 4})
Traceback (most recent call last):
...
ValueError: 'my_num' is not divisible by 3
>>>
It is also possible to define *custom types* and *custom test functions* as shown in the following example.
.. code:: python
>>> from schemadict import schemadict, STANDARD_VALIDATORS
>>> class MyOcean:
... has_dolphins = True
... has_plastic = False
...
>>>
>>> def has_dolphins(key, value, comp_value, _):
... if getattr(value, 'has_dolphins') is not comp_value:
... raise ValueError(f"{key!r} does not have dolphins")
...
>>>
>>> my_validators = STANDARD_VALIDATORS
>>> my_validators.update({MyOcean: {'has_dolphins': has_dolphins}})
>>>
>>> schema_ocean = schemadict(
... {'ocean': {'type': MyOcean, 'has_dolphins': True}},
... validators=my_validators,
... )
>>>
>>> ocean1 = MyOcean()
>>> schema_ocean.validate({'ocean': ocean1})
>>>
>>> ocean2 = MyOcean()
>>> ocean2.has_dolphins = False
>>> schema_ocean.validate({'ocean': ocean2})
Traceback (most recent call last):
...
ValueError: 'ocean' does not have dolphins
Full documentation: https://schemadict.readthedocs.io/
Features
========
What *schemadict* offers:
* Built-in support for Python's primitive types
* Specify *required* and *optional* keys
* Validate *nested* schemas
* Add custom validation functions to built-in types
* Add custom validation functions to custom types
* Support for Regex checks of strings
Features currently in development
* Metaschema validation
* Lazy validation and summary of all errors
* Allow schema variations: schmea 1 OR schema 2
* Add support for validation of type `number.Number`
Installation
============
*Schemadict* is available on `PyPI <https://pypi.org/project/schemadict/>`_ and may simply be installed with
.. code::
pip install schemadict
Idea
====
*Schemadict* is loosely inspired by `JSON schema <https://json-schema.org/>`_ and `jsonschema <https://github.com/Julian/jsonschema>`_, a JSON schema validator for Python.
License
=======
**License:** Apache-2.0
|
/schemadict-0.0.9.tar.gz/schemadict-0.0.9/README.rst
| 0.954658 | 0.652961 |
README.rst
|
pypi
|
from collections import defaultdict
from typing import Union
import pyarrow.parquet as pq
from schemadiff.filesystem import FileSystem
class SchemaExtractor:
"""A class for extracting schema from Parquet files."""
@staticmethod
def get_schema_from_parquet(parquet_file: pq.ParquetFile) -> list[tuple[str, str]]:
"""Returns a sorted list of tuples, where each tuple represents a field in the
schema.
Args:
parquet_file (pq.ParquetFile): The Parquet file to extract the schema from.
Returns:
list[Tuple[str, str]]: A sorted list of tuples, where each tuple represents a
field in the schema.
"""
arrow_schema = parquet_file.schema_arrow
return sorted((field.name, str(field.type)) for field in arrow_schema)
class SchemaComparer:
"""A class for comparing schemas of Parquet files."""
@staticmethod
def group_files_by_schema(
file_handler: FileSystem, dir_path: str, return_type: str = "as_dict"
) -> Union[dict[str, list[str]], list[list[str]]]:
"""Returns a dictionary or list that groups files by their schema.
Args:
file_handler (FileSystem): The file system handler.
dir_path (str): The directory path.
return_type (str, optional): The return type. Can be 'as_dict' or 'as_list'.
Defaults to 'as_dict'.
Returns:
Union[dict[str, list[str]], list[list[str]]]: A dictionary or list that groups
files by their schema.
"""
files = file_handler.list_files(dir_path)
schema_to_files = defaultdict(list)
for file in files:
parquet_file = file_handler.get_parquet_file(file)
schema = SchemaExtractor.get_schema_from_parquet(parquet_file)
schema_to_files[str(schema)].append(file)
if return_type == "as_list":
return list(schema_to_files.values())
else:
return dict(schema_to_files)
|
/schemadiffed-0.1.0.1.tar.gz/schemadiffed-0.1.0.1/schemadiff/schema_comparer.py
| 0.935236 | 0.320609 |
schema_comparer.py
|
pypi
|
import importlib.util
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Optional, Union
import pyarrow.parquet as pq
from schemadiff.m_exceptions import FileSystemError
class FileSystem(ABC):
"""An abstract base class for file system interactions.
This class defines the interface for a file system, including methods to
list files and retrieve Parquet files.
"""
@abstractmethod
def list_files(self, dir_path: Union[str, Path]) -> list[str]:
"""Abstract method that should return a list of file paths."""
pass
@abstractmethod
def get_parquet_file(self, file_path: str) -> pq.ParquetFile:
"""Abstract method that should return a ParquetFile object."""
pass
class LocalFileSystem(FileSystem):
"""A class to interact with a local filesystem. Inherits from the abstract base class
FileSystem.
Methods:
list_files(dir_path: str) -> list[str]:
Returns a list of Parquet file paths in the directory.
get_parquet_file(file_path: str) -> pq.ParquetFile:
Returns a ParquetFile object.
"""
def list_files(self, dir_path: Path) -> list[str]:
"""Lists all Parquet files in the provided directory."""
dir_path = Path(dir_path)
if "*" in dir_path.name: # If the last part of the path contains a wildcard
file_pattern = dir_path.name
dir_path = dir_path.parent
else:
file_pattern = "*.parquet"
if not dir_path.is_dir():
raise FileSystemError(f"{dir_path} is not a directory.")
return sorted(str(path) for path in dir_path.glob(file_pattern))
def get_parquet_file(self, file_path: str) -> pq.ParquetFile:
"""Loads a Parquet file from the local filesystem."""
file_path_obj = Path(file_path)
if not file_path_obj.is_file():
raise FileSystemError(f"{file_path} is not a file.")
if file_path_obj.suffix != ".parquet":
raise FileSystemError(f"{file_path} is not a Parquet file.")
try:
return pq.ParquetFile(file_path)
except Exception as e:
raise FileSystemError(
f"Error opening {file_path} as a Parquet file: {str(e)}"
)
class S3FileSystem(FileSystem):
"""A class to interact with Amazon S3. Inherits from the abstract base class
FileSystem."""
def __init__(self, **kwargs):
if importlib.util.find_spec("s3fs") is None:
raise ImportError(
"The s3fs library is required to use the S3FileSystem class."
)
import s3fs
self.fs = s3fs.S3Filesystem()
def list_files(self, dir_path: str) -> list[str]:
"""Lists all files in the provided S3 directory."""
return ["s3://" + path for path in sorted(self.fs.glob(dir_path))]
def get_parquet_file(self, file_path: str) -> pq.ParquetFile:
"""Loads a Parquet file from Amazon S3."""
try:
with self.fs.open(file_path) as f:
return pq.ParquetFile(f)
except Exception as e:
raise FileSystemError(
f"Error opening {file_path} as a Parquet file: {str(e)}"
)
class GCSFileSystem(FileSystem):
"""A class to interact with Google Cloud Storage. Inherits from the abstract base
class FileSystem."""
def __init__(self):
if importlib.util.find_spec("gcsfs") is None:
raise ImportError(
"The gcsfs library is required to use the GCSFileSystem class."
)
import gcsfs
self.fs = gcsfs.GCSFileSystem()
def list_files(self, dir_path: str) -> list[str]:
"""Lists all files in the provided GCS directory."""
return ["gs://" + path for path in sorted(self.fs.glob(dir_path))] # type: ignore
def get_parquet_file(self, file_path: str) -> pq.ParquetFile:
"""Loads a Parquet file from Google Cloud Storage."""
try:
with self.fs.open(file_path) as f:
return pq.ParquetFile(f)
except Exception as e:
raise FileSystemError(
f"Error opening {file_path} as a Parquet file: {str(e)}"
)
class FileSystemFactory:
"""A factory class for creating FileSystem instances.
Methods:
create_filesystem(type: str) -> Union[LocalFileSystem, None]:
Returns a FileSystem object of the specified type.
"""
@staticmethod
def create_filesystem(
type: Optional[str] = None, path: Optional[str] = None
) -> Union[LocalFileSystem, GCSFileSystem, S3FileSystem]:
"""
Returns a FileSystem object of the specified type.
Args:
type (str, optional): The type of filesystem. Can be 'local', 'gcs', or 's3'.
path (str, optional): The path from which to infer the filesystem type if no type is provided.
Returns:
Union[LocalFileSystem, GCSFileSystem, S3FileSystem]: A FileSystem object of the specified type.
Raises:
ValueError: If an unsupported filesystem type is provided.
"""
if type is None:
if path.startswith("gs://"): # type: ignore
type = "gcs"
elif path.startswith("s3://"): # type: ignore
type = "s3"
else:
type = "local"
if type == "local":
return LocalFileSystem()
elif type == "gcs":
return GCSFileSystem()
elif type == "s3":
return S3FileSystem()
else:
raise ValueError(f"Unsupported filesystem type: {type}")
|
/schemadiffed-0.1.0.1.tar.gz/schemadiffed-0.1.0.1/schemadiff/filesystem.py
| 0.889075 | 0.34392 |
filesystem.py
|
pypi
|
from typing import Optional, Union
from schemadiff.filesystem import FileSystemFactory
from schemadiff.report_generator import ReportGenerator
from schemadiff.schema_comparer import SchemaComparer, SchemaExtractor
def compare_schemas(
dir_path: str,
fs_type: Optional[str] = None,
report_path: Union[str, None] = None,
return_type: str = "as_list",
) -> Union[dict[str, list[str]], list[list[str]]]:
"""Compares schemas of Parquet files in a directory and optionally generates a report.
Args:
dir_path (str): The directory path.
fs_type (str, optional): The type of filesystem. Can be 'local', 'gcs', or 's3'.
Defaults to 'local'.
report_path (Union[str, None], optional): The file path where the report will be
saved. If None, no report is generated. Defaults to None.
return_type (str, optional): The return type. Can be 'as_dict' or 'as_list'.
Defaults to 'as_list'.
Returns:
Union[dict[str, list[str]], list[list[str]]]: A dictionary or list that groups
files by their schema.
"""
fs = FileSystemFactory.create_filesystem(fs_type, dir_path)
grouped_files = SchemaComparer.group_files_by_schema(fs, dir_path, return_type)
if report_path is not None:
all_schemas = [
SchemaExtractor.get_schema_from_parquet(fs.get_parquet_file(file_group[0]))
for file_group in grouped_files
]
# Finding differences between all schemas
common_schema = set(all_schemas[0])
for schema in all_schemas[1:]:
common_schema.intersection_update(schema)
differences = [list(set(schema) - common_schema) for schema in all_schemas]
schema_to_files = {
str(difference): file_group
for difference, file_group in zip(differences, grouped_files)
}
report = ReportGenerator.generate_report(schema_to_files) # type: ignore
ReportGenerator.save_report(report, report_path)
return grouped_files
|
/schemadiffed-0.1.0.1.tar.gz/schemadiffed-0.1.0.1/schemadiff/__init__.py
| 0.916507 | 0.257042 |
__init__.py
|
pypi
|
=========================
Schemagic / Schemagic.web
=========================
.. image:: https://img.shields.io/badge/pypi-v0.9.1-blue.svg
:target: https://pypi.python.org/pypi/schemagic
.. image:: https://img.shields.io/badge/ReadTheDocs-latest-red.svg
:target: http://schemagic.readthedocs.io/en/latest/schemagic.html
.. image:: https://travis-ci.org/Mechrophile/schemagic.svg?branch=master
:target: https://travis-ci.org/Mechrophile/schemagic/
Remove the Guesswork from Data Processing
=========================================
Schemagic is a rather utilitarian re-imagining of the wonderful and powerful clojure library `Schema <https://github.com/plumatic/schema>`_!
Schemagic.web is what programmers do when they hate web programming, but want to make their programs accessible to the web.
Installation
------------
It's a wheel on Pypi, and it's 2 and 3 compatible.
To install Schemagic, simply:
.. code-block:: bash
$ pip install schemagic
What is schemagic?
------------------
One of the difficulties with large scale, multi-team python efforts is the overhead of understanding the kind of data
(e.g., list of strings, nested map from long to string to double) that a function or a webservice expects and returns.
Python lacks static typing and, moreover, static typing is insufficient to capture and validate custom business types,
which ultimately is what holds back teams from rapidly iterating on each others work.[1]
To you, the programmer, schemagic is all about three things:
* data **description** using the simplest python data structures and an easily extensible syntax
* data **communication** between teams, enhancing documentation, giving feedback when something went wrong.
* data **validation** based on descriptions of data that have been documented and communicated.
Comments describing the shape of data are insufficient in real world applications.
Unless the documentation is backed up by programmatic verification, the documentation gets initially ignored,
and ultimately falls behind the actual program behavior.
In other words, **schemagic is all about data**.
Getting Acquainted with Schemagic
---------------------------------
Lets build a schema and start using it.
.. code-block:: python
>>> import schemagic
>>> list_of_ints = [int]
>>> schemagic.validate_against_schema(list_of_ints, [1, 2, 3])
[1, 2, 3]
>>> schemagic.validate_against_schema(list_of_ints, ["hello", "my friends"])
Traceback (most recent call last):
...
ValueError: invalid literal for int() with base 10: 'hello'
The error you see here (customizeable) is the error you get when you try to call:
.. code-block:: python
>>> int("hello")
Traceback (most recent call last):
...
ValueError: invalid literal for int() with base 10: 'hello'
And it occurred because list_of_ints specified that the function to check every member of the list against was int()
Basic Schemagic Usage
---------------------
Schema checking is quite flexible, and all checks are done recursively. Lets go through some more examples:
**Map Template**:
*if you only provide a schema with one (callable) key and one value*
.. code-block:: python
>>> string_to_int_map = {str:int}
>>> schemagic.validate_against_schema(string_to_int_map, {"hello": 5, "friends": 6})
{'friends': 6, 'hello': 5}
**Map with Specific Keys**
*if you provide a schema with strings as keys*
.. code-block:: python
>>> friend_record = {"name":str, "age": int}
>>> schemagic.validate_against_schema(friend_record, {"name": "Tyler", "age": 400})
{'name': 'Tyler', 'age': 400}
**Sequence Template**:
*if you provide a sequence containing only one item as a schema*
.. code-block:: python
>>> list_of_ints = [int]
>>> schemagic.validate_against_schema(list_of_ints, [1, 2, 3, 4])
[1, 2, 3, 4]
**Strict Sequence**:
*if you provide a sequence with multiple items as a schema*
.. code-block:: python
>>> list_with_3_items_int_str_and_intstrmap = [int, str, {int: str}]
>>> schemagic.validate_against_schema(list_with_3_items_int_str_and_intstrmap, [1, "hello", {5: "friends", 12: "and", 90: "world"}])
[1, "hello", {5: "friends", 12: "and", 90: "world"}]
**Validation Function**:
*if you provide a function as a schema*
.. code-block:: python
>>> def null(data):
... if data is not None:
... raise TypeError("expected Nonetype, got {0}".format(data))
>>> schemagic.validate_against_schema(null, None)
>>> schemagic.validate_against_schema(null, "hello!")
Traceback (most recent call last):
...
TypeError: expected Nonetype, got hello
**Compose Schema Definitions Recursively Ad Nauseam**:
*this is where the real value lies*
.. code-block:: python
>>> def enum(*possible_values):
... def _validator(data):
... if not data in possible_values:
... raise ValueError()
... return data
... return _validator
>>> event = {
... "event_type": enum("PRODUCTION", "DEVELOPMENT"),
... "event_name": str
...}
>>> dispatch_request = {
... "events": [event],
... "requested_by": str
...}
>>> schemagic.validate_against_schema(dispatch_request,
... {"events": [{"event_type": "DEVELOPMENT",
... "event_name": "demo_business_process"},
... {"event_type": "DEVELOPMENT",
... "event_name": "demo_other_business_process"}],
... "requested_by": "Tyler Tolton"})
{"events": [{"event_type": "DEVELOPMENT", "event_name": "demo_business_process"}, {"event_type": "DEVELOPMENT", "event_name": "demo_other_business_process"}], "requested_by": "Tyler Tolton"}
Schemagic.validator Usage
-------------------------
**Use the Schemagic.validator for increased message clarity and control**:
.. code-block:: python
>>> list_of_ints_validator = schemagic.validator([int], "Business Type: list of integers")
>>> list_of_ints_validator([1, "not an int", 3])
Traceback (most recent call last):
...
ValueError: Bad value provided for Business Type: list of integers. - error: ValueError: invalid literal for int() with base 10: 'not an int' schema: [<type 'int'>] value: [1, 'not an int', 3]
**Supply predicate to prevent/enable validation conditionally**:
.. code-block:: python
>>> __env__ = None
>>> WHEN_IN_DEV_ENV = lambda: __env__ == "DEV"
>>> validate_in_dev = partial(schemagic.validator, validation_predicate=WHEN_IN_DEV_ENV)
>>> list_of_ints_validator = validate_in_dev([int], "integer list")
>>> __env__ = "DEV"
>>> list_of_ints_validator([1, "not an int", 3])
Traceback (most recent call last):
...
ValueError: Bad value provided for integer list. - error: ValueError: invalid literal for int() with base 10: 'not an int' schema: [<type 'int'>] value: [1, 'not an int', 3]
>>> __env__ = "PROD"
>>> list_of_ints_validator([1, "not an int", 3])
[1, "not an int", 3]
**Coerce data as it is validated**:
*note: validate_against_schema will do this automatically. see docs on validator.*
.. code-block:: python
>>> validate_and_coerce = partial(schemagic.validator, coerce_data=True)
>>> list_of_ints_validator_and_coercer = validate_and_coerce([int], "integer list")
>>> list_of_ints_validator_only = schemagic.validator([int], "integer_list")
>>> list_of_ints_validator_only(["1", "2", "3"])
["1", "2", "3"]
>>> # Note that the if you pass an integer string to int() it returns an integer.
>>> # this makes it s dual purpose validator and coercer.
>>> list_of_ints_validator_and_coercer(["1", "2", "3"])
[1, 2, 3]
Schemagic.web
-------------
Schemagic.web is where rubber meets the road in practical usage. It provides an easy way to communicate between
services, between developers, and between development teams in an agile environment. The webservice business world was
the furnace in which schemagic was forged. Get ready to outsource yourself.
To demo the schemagic.web workflow, lets assume the roles of the first people in the world to discover a way
to (gasp) compute the fibonacci sequence in python.
*note: this code is all pulled from Peter Norvig's excellent* `Design of Computer Programs <https://www.udacity.com/course/design-of-computer-programs--cs212>`_ *Udacity class.*
.. code-block:: python
def memo(fn):
_cache = {}
def _f(*args):
try:
return _cache[args]
except KeyError:
_cache[args] = result = fn(*args)
return result
except TypeError:
return fn(*args)
_f.cache = _cache
return _f
@memo
def fib(n):
if n == 0 or n == 1:
return 1
else:
return fib(n - 1) + fib(n - 2)
>>> fib(30)
1346269
Brilliant! Well, now we'll of course want to share this discovery with the world in the form of a microservice, so that
others need not know the inner workings of this complex and dangerous algorithm.
Lets walk through how we might set up this webservice in flask:
.. code-block:: python
from flask import Flask, json
from fibonacci import fib # assuming we implemented the function in fibonnaci.py
app = Flask(__name__)
@app.route("/fibonacci/<index>")
def web_fib_endpoint(index):
try:
index = int(index)
except ValueError:
return Response(
status=400,
response="Argument to /fibonacci/ must be an integer"
)
return Response(
status=200,
response=json.dumps(fib(index))
)
if __name__ == '__main__':
app.run(port=5000)
While this pattern is certainly serviceable, it is rather heavyweight to simply expose a function to the web.
Additionally, the code doesn't lend itself well to easily documenting its input and output.
Lets see an adapted version of this code using schemagic.web utilities.
.. code-block:: python
from flask.app import Flask
from fibonacci import fib # assuming we implemented the function in fibonnaci.py
from schemagic.web import service_registry
app = Flask(__name__)
register_fibonnacci_services = service_registry(app)
register_fibonnacci_services(
dict(rule="/fibonacci",
input_schema=int,
output_schema=int,
fn=fib))
if __name__ == '__main__':
app.run(port=5000)
There, now we simply *describe* our service with data.
What is the service endpoint, what is the input, what is the output,
and what is the implementation that delivers the contract defined herein.
#. The webservices all uniformally use POST requests to transmit data. The data supplied to the endpoints comes from the payload of the request.
How to Contribute
-----------------
#. This codebase uses the popular `git flow <http://nvie.com/posts/a-successful-git-branching-model/>`_ model for version control
#. Fork `the repository`_ and make a branch off of develop, (ideally using the naming convention feature/your-feature)
#. When you've finished your feature, make a pull request back into develop.
#. Once you've made your pull request, email `the maintainer`_ and let me know!
#. Finally, if you ever have any questions about how or what to contribute, feel free to send an email!
.. _`the repository`: https://github.com/TJTolton/schemagic
.. _`the maintainer`: [email protected]
Documentation
=============
This project autogenerates it's documentation using sphinx and hosts it using readthedocs. It can be viewed `here <http://schemagic.readthedocs.io/en/latest/schemagic.html>`_
.. [1] Please note: this description is adapted from the excellently phrased introduction to the `prismatic/schema <https://github.com/plumatic/schema>`_ clojure library this project was based on
|
/schemagic-0.9.1.tar.gz/schemagic-0.9.1/README.rst
| 0.881513 | 0.689547 |
README.rst
|
pypi
|
from collections import OrderedDict as od
from .misc import AutoRepr, quoted_identifier
class Inspected(AutoRepr):
@property
def quoted_full_name(self):
return "{}.{}".format(
quoted_identifier(self.schema), quoted_identifier(self.name)
)
@property
def signature(self):
return self.quoted_full_name
@property
def unquoted_full_name(self):
return "{}.{}".format(self.schema, self.name)
@property
def quoted_name(self):
return quoted_identifier(self.name)
@property
def quoted_schema(self):
return quoted_identifier(self.schema)
def __ne__(self, other):
return not self == other
class TableRelated(object):
@property
def quoted_full_table_name(self):
return "{}.{}".format(
quoted_identifier(self.schema), quoted_identifier(self.table_name)
)
class ColumnInfo(AutoRepr):
def __init__(
self,
name,
dbtype,
pytype,
default=None,
not_null=False,
is_enum=False,
enum=None,
dbtypestr=None,
collation=None,
is_identity=False,
is_identity_always=False,
is_generated=False,
):
self.name = name or ""
self.dbtype = dbtype
self.dbtypestr = dbtypestr or dbtype
self.pytype = pytype
self.default = default or None
self.not_null = not_null
self.is_enum = is_enum
self.enum = enum
self.collation = collation
self.is_identity = is_identity
self.is_identity_always = is_identity_always
self.is_generated = is_generated
def __eq__(self, other):
return (
self.name == other.name
and self.dbtype == other.dbtype
and self.dbtypestr == other.dbtypestr
and self.pytype == other.pytype
and self.default == other.default
and self.not_null == other.not_null
and self.enum == other.enum
and self.collation == other.collation
and self.is_identity == other.is_identity
and self.is_identity_always == other.is_identity_always
and self.is_generated == other.is_generated
)
def alter_clauses(self, other):
# ordering:
# identify must be dropped before notnull
# notnull must be added before identity
clauses = []
not_null_change = self.not_null != other.not_null
if not_null_change and self.not_null:
clauses.append(self.alter_not_null_clause)
if self.default != other.default and not self.default:
clauses.append(self.alter_default_clause)
if (
self.is_identity != other.is_identity
or self.is_identity_always != other.is_identity_always
):
clauses.append(self.alter_identity_clause(other))
elif self.default != other.default and self.default:
clauses.append(self.alter_default_clause)
if not_null_change and not self.not_null:
clauses.append(self.alter_not_null_clause)
if self.dbtypestr != other.dbtypestr or self.collation != other.collation:
clauses.append(self.alter_data_type_clause)
return clauses
def change_enum_to_string_statement(self, table_name):
if self.is_enum:
return "alter table {} alter column {} set data type varchar using {}::varchar;".format(
table_name, self.quoted_name, self.quoted_name
)
else:
raise ValueError
def change_string_to_enum_statement(self, table_name):
if self.is_enum:
return "alter table {} alter column {} set data type {} using {}::{};".format(
table_name,
self.quoted_name,
self.dbtypestr,
self.quoted_name,
self.dbtypestr,
)
else:
raise ValueError
def drop_default_statement(self, table_name):
return "alter table {} alter column {} drop default;".format(
table_name, self.quoted_name
)
def add_default_statement(self, table_name):
return "alter table {} alter column {} set default {};".format(
table_name, self.quoted_name, self.default
)
def alter_table_statements(self, other, table_name):
prefix = "alter table {}".format(table_name)
return ["{} {};".format(prefix, c) for c in self.alter_clauses(other)]
@property
def quoted_name(self):
return quoted_identifier(self.name)
@property
def creation_clause(self):
x = "{} {}".format(self.quoted_name, self.dbtypestr)
if self.is_identity:
identity_type = "always" if self.is_identity_always else "by default"
x += " generated {} as identity".format(identity_type)
if self.not_null:
x += " not null"
if self.is_generated:
x += " generated always as ({}) stored".format(self.default)
elif self.default:
x += " default {}".format(self.default)
return x
@property
def add_column_clause(self):
return "add column {}{}".format(self.creation_clause, self.collation_subclause)
@property
def drop_column_clause(self):
return "drop column {k}".format(k=self.quoted_name)
@property
def alter_not_null_clause(self):
keyword = "set" if self.not_null else "drop"
return "alter column {} {} not null".format(self.quoted_name, keyword)
@property
def alter_default_clause(self):
if self.default:
alter = "alter column {} set default {}".format(
self.quoted_name, self.default
)
else:
alter = "alter column {} drop default".format(self.quoted_name)
return alter
def alter_identity_clause(self, other):
if self.is_identity:
identity_type = "always" if self.is_identity_always else "by default"
if other.is_identity:
alter = "alter column {} set generated {}".format(
self.quoted_name, identity_type
)
else:
alter = "alter column {} add generated {} as identity".format(
self.quoted_name, identity_type
)
else:
alter = "alter column {} drop identity".format(self.quoted_name)
return alter
@property
def collation_subclause(self):
if self.collation:
collate = " collate {}".format(quoted_identifier(self.collation))
else:
collate = ""
return collate
@property
def alter_data_type_clause(self):
return "alter column {} set data type {}{} using {}::{}".format(
self.quoted_name,
self.dbtypestr,
self.collation_subclause,
self.quoted_name,
self.dbtypestr,
)
class InspectedSelectable(Inspected):
def __init__(
self,
name,
schema,
columns,
inputs=None,
definition=None,
dependent_on=None,
dependents=None,
comment=None,
relationtype="unknown",
parent_table=None,
partition_def=None,
rowsecurity=False,
forcerowsecurity=False,
persistence=None,
):
self.name = name
self.schema = schema
self.inputs = inputs or []
self.columns = columns
self.definition = definition
self.relationtype = relationtype
self.dependent_on = dependent_on or []
self.dependents = dependents or []
self.dependent_on_all = []
self.dependents_all = []
self.constraints = od()
self.indexes = od()
self.comment = comment
self.parent_table = parent_table
self.partition_def = partition_def
self.rowsecurity = rowsecurity
self.forcerowsecurity = forcerowsecurity
self.persistence = persistence
def __eq__(self, other):
equalities = (
type(self) == type(other),
self.relationtype == other.relationtype,
self.name == other.name,
self.schema == other.schema,
dict(self.columns) == dict(other.columns),
self.inputs == other.inputs,
self.definition == other.definition,
self.parent_table == other.parent_table,
self.partition_def == other.partition_def,
self.rowsecurity == other.rowsecurity,
self.persistence == other.persistence,
)
return all(equalities)
|
/schemahq-schemainspect-1.0.12.tar.gz/schemahq-schemainspect-1.0.12/schemainspect/inspected.py
| 0.715623 | 0.169543 |
inspected.py
|
pypi
|
import typing as t
from datetime import (
date,
datetime,
timezone,
)
from enum import Enum
from functools import reduce
from json import JSONEncoder
from re import fullmatch
from types import UnionType, NoneType
from uuid import UUID
from zoneinfo import (
ZoneInfo,
ZoneInfoNotFoundError,
)
import jwt
import jwt.algorithms
import phonenumbers
JsonType = t.Union[
None, int, float, str, bool, list["JsonType"], dict[str, "JsonType"]
]
JsonRoot = dict[str, JsonType]
class InternalObjectTypeString(str):
object_class: t.Type[t.Any]
value: t.Any
def __new__(cls, value: str | t.Any) -> "InternalObjectTypeString":
try:
string, obj = cls.convert(value)
except Exception as e:
raise ValueError
instance = str.__new__(cls, string)
instance.value = obj
return instance
@classmethod
def convert(cls, value: str | t.Any) -> t.Tuple[str, t.Any]:
return NotImplemented
class Date(InternalObjectTypeString):
object_class = date
@classmethod
def convert(cls, value: str | date) -> t.Tuple[str, date]:
if isinstance(value, str):
obj = cls.object_class.fromisoformat(value)
string = obj.isoformat()
if isinstance(value, cls.object_class):
obj = value
string = obj.isoformat()
return string, obj
class DateTime(InternalObjectTypeString):
object_class = datetime
@classmethod
def convert(cls, value: str | datetime) -> t.Tuple[str, datetime]:
if isinstance(value, str) and len(value) > 10:
obj = cls.object_class.fromisoformat(value).astimezone(timezone.utc)
string = obj.isoformat()
if isinstance(value, cls.object_class):
obj = value.astimezone(timezone.utc)
string = obj.isoformat()
return string, obj
class JWTDecodeKwargs(t.TypedDict, total=False):
key: t.Union["jwt.algorithms.AllowedPublicKeys", str, bytes] # type: ignore
algorithms: list[str]
options: dict[str, t.Any] | None
detached_payload: bytes | None
class JWTEncodeKwargs(t.TypedDict, total=False):
key: t.Union["jwt.algorithms.AllowedPrivateKeys", str, bytes] # type: ignore
algorithm: str
headers: JsonRoot | None
json_encoder: type[JSONEncoder] | None
class JWTToken(str):
claims: JsonRoot
def __new__(cls, token: str | bytes) -> "JWTToken":
try:
claims = jwt.decode(token, **cls.token_config())
except Exception:
raise ValueError("Invalid string for JWT Token")
obj = str.__new__(cls, token)
obj.claims = claims
return obj
@classmethod
def token_config(cls) -> JWTDecodeKwargs:
from os import environ
JWT_SECRET = "JWT_SECRET"
return dict(
key=environ.get(JWT_SECRET, ""),
algorithms=["HS256"],
)
@classmethod
def from_decode_kwargs(
cls, decode_kwargs: JWTDecodeKwargs
) -> "JWTEncodeKwargs":
return JWTEncodeKwargs(
algorithm=decode_kwargs["algorithms"][0],
json_encoder=SchemaEncoder,
headers=None,
)
@classmethod
def generate(
cls, data: JsonRoot, algorithm: str | None = None
) -> "JWTToken":
encode_config = cls.from_decode_kwargs(cls.token_config())
if algorithm is not None:
encode_config["algorithm"] = algorithm
return cls(jwt.encode(data, **encode_config))
@classmethod
def from_http_header(cls, header: str | None) -> "JWTToken":
if header is None:
raise ValueError("Missing header value.")
try:
_, token = header.split()
except Exception:
raise ValueError("Unable to distinguish bearer and token.")
return cls(token)
class Phone(InternalObjectTypeString):
object_class = phonenumbers.PhoneNumber
@classmethod
def convert(
cls, value: str | phonenumbers.PhoneNumber
) -> t.Tuple[str, phonenumbers.PhoneNumber]:
is_string = isinstance(value, str)
is_phone_obj = isinstance(value, phonenumbers.PhoneNumber)
try:
if not is_string and not is_phone_obj:
raise TypeError
if is_phone_obj:
obj: phonenumbers.PhoneNumber = value # type: ignore
else:
obj = phonenumbers.parse(
value, None, keep_raw_input=True # type: ignore
)
except (TypeError, phonenumbers.NumberParseException) as e:
raise ValueError
string = phonenumbers.format_number(
obj,
phonenumbers.PhoneNumberFormat.E164,
)
if obj.raw_input and obj.raw_input != string:
raise ValueError("Incorrect format for phone number.")
return string, obj
class RegexValidatedString(str):
regex = ".*"
def __new__(cls, string: str) -> "RegexValidatedString":
if not fullmatch(cls.regex, string):
raise ValueError
return str.__new__(cls, string)
class Email(RegexValidatedString):
regex = r"\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b"
class IANATimeZone(str):
def __new__(cls, timezone: str) -> "IANATimeZone":
try:
ZoneInfo(timezone)
except (ValueError, ZoneInfoNotFoundError):
raise ValueError
return str.__new__(cls, timezone)
class MetaSchema(type):
_field_array: tuple[str, ...]
_field_optional: tuple[str, ...]
_field_types: dict[str, type]
def __new__(
cls, name: str, bases: tuple[str, ...], attrs: dict[str, t.Any] = {}
) -> "MetaSchema":
annotations = attrs.get("__annotations__", {})
field_optional: list[str] = []
field_array: list[str] = []
field_types: dict[str, type] = {}
for attr_name, _type in annotations.items():
# To detect if it's an Optional field, a Union with None.
if cls._none_type_compatible(_type):
field_optional.append(attr_name)
_type = cls._get_type_from_union(_type, attr_name)
# To detect if it's a List type hint.
if cls._array_type_compatible(_type):
field_array.append(attr_name)
_type = cls._get_type_from_list(_type, attr_name)
# by this point we should have a concrete type
if not isinstance(_type, type):
raise AttributeError(
f"Bad attribute type hint for '{attr_name}'",
)
field_types[attr_name] = _type
obj = super().__new__(cls, name, bases, attrs) # type: ignore
obj._field_array = tuple(field_array)
obj._field_optional = tuple(field_optional)
obj._field_types = field_types
return obj
@classmethod
def _none_type_compatible(cls, field: type) -> bool:
"""
This method will enforce a validation to determine if it's a Union with None
exclusively, the meaning of this would end up determining if it's an
optional field or not.
"""
return (
isinstance(field, UnionType)
and len(field.__args__) == 2
and NoneType in field.__args__
)
@classmethod
def _array_type_compatible(cls, field: type) -> bool:
"""
This method will enforce a validation to determine if it's a `typing.List` object
with.
For now we will only support homogeneous arrays of a concrete type.
"""
return hasattr(field, "__origin__") and field.__origin__ == list
@classmethod
def _get_type_from_list(cls, field: UnionType, field_name: str) -> type:
return field.__args__[0] # type: ignore
@classmethod
def _get_type_from_union(cls, field: UnionType, field_name: str) -> type:
if len(field.__args__) != 2 or NoneType not in field.__args__:
raise AttributeError(
f"Attributes must be a concrete type or optional concrete type '{field_name}'"
)
return [_t for _t in field.__args__ if _t != NoneType][0] # type: ignore
class Schema(metaclass=MetaSchema):
def __init__(self, **kwargs: dict[str, t.Any]) -> None:
annotations = self._annotations()
extra_keys = set(kwargs.keys()).difference(annotations.keys())
if extra_keys:
raise ValueError(f"Extra arguments provided {extra_keys}.")
for attribute, _type in self.__class__._field_types.items():
value = kwargs.get(attribute, None)
_type_constructor = (
(lambda x: _type.from_dict(x))
if issubclass(_type, Schema)
else _type
)
if not callable(_type_constructor):
# TODO: get this line covered in a test.
raise ValueError(
"Type hint does not allow for object creation by call."
)
if isinstance(value, _type) or (
value is None and attribute in self.__class__._field_optional
):
self.__dict__[attribute] = value
elif isinstance(value, list) and attribute in self._field_array:
self.__dict__[attribute] = [_type_constructor(v) for v in value]
else:
self.__dict__[attribute] = _type_constructor(value)
def __repr__(self) -> str:
returnable = f"<{self.__class__.__name__} "
for k, v in self.to_dict().items():
returnable += f"{k}={v.__repr__()} "
return returnable + ">"
def to_dict(self) -> JsonRoot:
return {k: getattr(self, k) for k in self.__class__._annotations()}
def to_minimal_dict(self) -> JsonRoot:
return {k: v for k, v in self.to_dict().items() if v is not None}
@classmethod
def from_dict(cls, data: t.Union[JsonRoot, "Schema"]) -> "Schema":
if isinstance(data, Schema):
return data
annotations = cls._annotations().keys()
if set(data.keys()) - annotations:
raise ValueError("Arguments outside schema were provided.")
kwargs: dict[str, t.Any] = {
**cls._nullable_fields(),
**cls._default_values(),
**{k: v for k, v in data.items() if k in annotations},
}
return cls(**kwargs)
@classmethod
def _annotations(cls) -> dict[str, type]:
return reduce(
lambda acc, cur: {**acc, **getattr(cur, "__annotations__", {})},
filter(lambda x: x is not Schema, reversed(cls.__mro__)),
{},
)
@classmethod
def _default_values(cls) -> dict[str, t.Any]:
return {
k: getattr(cls, k)
for k in set(dir(cls)).intersection(cls._annotations())
}
@classmethod
def _nullable_fields(cls) -> dict[str, None]:
return {
field: None
for field in cls._annotations().keys()
if field in cls._field_optional
}
@classmethod
def enforce(
cls,
schema: t.Optional[t.Type["Schema"]],
data: t.Union[JsonRoot, "Schema", None],
allow_none: bool = False,
) -> t.Union["Schema", JsonRoot, None]:
"""
This serves as a generic to convert a dictionary output as a schema,
meant to be used driven by a function's type annotations.
"""
if schema is None and allow_none is True:
return data
if schema is None and allow_none is False:
raise TypeError("Schema argument can not be None")
# At this point we know schema is not None.
if not issubclass(schema, Schema): # type: ignore
raise TypeError("Schema argument is not derived from class Schema.")
if data is None and allow_none is True:
return data
if data is None and allow_none is False:
raise ValueError("No data provided to convert in to schema.")
# At this point we know that schema is a subclass of Schema.
if isinstance(data, schema): # type: ignore
return data
try:
# And that data is the correct "json compatible" object
# we want to convert in to schema.
parsed = schema.from_dict(data) # type: ignore
except Exception:
raise ValueError("Error during parsing")
return parsed
def __eq__(self, other: t.Any) -> bool:
if (
isinstance(other, self.__class__)
and self.__class__ == other.__class__
):
for attr in self._annotations():
if getattr(self, attr) != getattr(other, attr):
return False
return True
return False
class SchemaEncoder(JSONEncoder):
def default(self, obj): # type: ignore
if isinstance(obj, UUID):
return str(obj)
if isinstance(obj, Enum):
return obj.value
if isinstance(obj, date):
return obj.isoformat()
if isinstance(obj, Schema):
return obj.to_dict()
return super().default(obj)
|
/schemander-0.0.7.tar.gz/schemander-0.0.7/schemander.py
| 0.668772 | 0.163145 |
schemander.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class USNonprofitType(BaseModel):
"""USNonprofitType: Non-profit organization type originating from the United States.
References:
https://schema.org/USNonprofitType
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
supersededBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Relates a term (i.e. a property, class or enumeration) to one that supersedes it.
"""
type_: str = Field(default="USNonprofitType", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
supersededBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/USNonprofitType.py
| 0.946966 | 0.312029 |
USNonprofitType.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class DisabilitySupport(BaseModel):
"""DisabilitySupport: this is a benefit for disability support.
References:
https://schema.org/DisabilitySupport
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
supersededBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Relates a term (i.e. a property, class or enumeration) to one that supersedes it.
"""
type_: str = Field(default="DisabilitySupport", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
supersededBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/DisabilitySupport.py
| 0.944421 | 0.312265 |
DisabilitySupport.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class CompoundPriceSpecification(BaseModel):
"""A compound price specification is one that bundles multiple prices that all apply in combination for different dimensions of consumption. Use the name property of the attached unit price specification for indicating the dimension of a price component (e.g. "electricity" or "final cleaning").
References:
https://schema.org/CompoundPriceSpecification
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
eligibleQuantity: (Optional[Union[List[Union[str, Any]], str, Any]]): The interval and unit of measurement of ordering quantities for which the offer or price specification is valid. This allows e.g. specifying that a certain freight charge is valid only for a certain quantity.
valueAddedTaxIncluded: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Specifies whether the applicable value-added tax (VAT) is included in the price specification or not.
minPrice: (Optional[Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]]): The lowest price if the price is a range.
price: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The offer price of a product, or of a price component when attached to PriceSpecification and its subtypes.Usage guidelines:* Use the [[priceCurrency]] property (with standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217), e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types, e.g. "Ithaca HOUR") instead of including [ambiguous symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign) such as '$' in the value.* Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator.* Note that both [RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute) and Microdata syntax allow the use of a "content=" attribute for publishing simple machine-readable values alongside more human-friendly formatting.* Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similar Unicode symbols.
validThrough: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.
maxPrice: (Optional[Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]]): The highest price if the price is a range.
validFrom: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date when the item becomes valid.
eligibleTransactionVolume: (Optional[Union[List[Union[str, Any]], str, Any]]): The transaction volume, in a monetary unit, for which the offer or price specification is valid, e.g. for indicating a minimal purchasing volume, to express free shipping above a certain order volume, or to limit the acceptance of credit cards to purchases to a certain minimal amount.
priceCurrency: (Union[List[Union[str, Any]], str, Any]): The currency of the price, or a price component when attached to [[PriceSpecification]] and its subtypes.Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217), e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types, e.g. "Ithaca HOUR".
priceType: (Union[List[Union[str, Any]], str, Any]): Defines the type of a price specified for an offered product, for example a list price, a (temporary) sale price or a manufacturer suggested retail price. If multiple prices are specified for an offer the [[priceType]] property can be used to identify the type of each such specified price. The value of priceType can be specified as a value from enumeration PriceTypeEnumeration or as a free form text string for price types that are not already predefined in PriceTypeEnumeration.
priceComponent: (Optional[Union[List[Union[str, Any]], str, Any]]): This property links to all [[UnitPriceSpecification]] nodes that apply in parallel for the [[CompoundPriceSpecification]] node.
"""
type_: str = Field(default="CompoundPriceSpecification", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
eligibleQuantity: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The interval and unit of measurement of ordering quantities for which the offer or price"
"specification is valid. This allows e.g. specifying that a certain freight charge is"
"valid only for a certain quantity.",
)
valueAddedTaxIncluded: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Specifies whether the applicable value-added tax (VAT) is included in the price specification"
"or not.",
)
minPrice: Optional[
Union[
List[Union[str, Any, StrictInt, StrictFloat]],
str,
Any,
StrictInt,
StrictFloat,
]
] = Field(
default=None,
description="The lowest price if the price is a range.",
)
price: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The offer price of a product, or of a price component when attached to PriceSpecification"
"and its subtypes.Usage guidelines:* Use the [[priceCurrency]] property (with standard"
"formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217),"
'e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies)'
'for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system)'
'(LETS) and other currency types, e.g. "Ithaca HOUR") instead of including [ambiguous'
"symbols](http://en.wikipedia.org/wiki/Dollar_sign#Currencies_that_use_the_dollar_or_peso_sign)"
"such as '$' in the value.* Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate"
"a decimal point. Avoid using these symbols as a readability separator.* Note that both"
"[RDFa](http://www.w3.org/TR/xhtml-rdfa-primer/#using-the-content-attribute)"
'and Microdata syntax allow the use of a "content=" attribute for publishing simple'
"machine-readable values alongside more human-friendly formatting.* Use values from"
"0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially"
"similar Unicode symbols.",
)
validThrough: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date after when the item is not valid. For example the end of an offer, salary period,"
"or a period of opening hours.",
)
maxPrice: Optional[
Union[
List[Union[str, Any, StrictInt, StrictFloat]],
str,
Any,
StrictInt,
StrictFloat,
]
] = Field(
default=None,
description="The highest price if the price is a range.",
)
validFrom: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date when the item becomes valid.",
)
eligibleTransactionVolume: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The transaction volume, in a monetary unit, for which the offer or price specification"
"is valid, e.g. for indicating a minimal purchasing volume, to express free shipping"
"above a certain order volume, or to limit the acceptance of credit cards to purchases"
"to a certain minimal amount.",
)
priceCurrency: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The currency of the price, or a price component when attached to [[PriceSpecification]]"
"and its subtypes.Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217),"
'e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies)'
'for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system)'
'(LETS) and other currency types, e.g. "Ithaca HOUR".',
)
priceType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Defines the type of a price specified for an offered product, for example a list price,"
"a (temporary) sale price or a manufacturer suggested retail price. If multiple prices"
"are specified for an offer the [[priceType]] property can be used to identify the type"
"of each such specified price. The value of priceType can be specified as a value from enumeration"
"PriceTypeEnumeration or as a free form text string for price types that are not already"
"predefined in PriceTypeEnumeration.",
)
priceComponent: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="This property links to all [[UnitPriceSpecification]] nodes that apply in parallel"
"for the [[CompoundPriceSpecification]] node.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/CompoundPriceSpecification.py
| 0.936431 | 0.568955 |
CompoundPriceSpecification.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class HealthAndBeautyBusiness(BaseModel):
"""Health and beauty.
References:
https://schema.org/HealthAndBeautyBusiness
Note:
Model Depth 4
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
serviceArea: (Optional[Union[List[Union[str, Any]], str, Any]]): The geographic area where the service is provided.
founder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person who founded this organization.
isicV4: (Union[List[Union[str, Any]], str, Any]): The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.
hasPOS: (Optional[Union[List[Union[str, Any]], str, Any]]): Points-of-Sales operated by the organization or person.
globalLocationNumber: (Union[List[Union[str, Any]], str, Any]): The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.
member: (Optional[Union[List[Union[str, Any]], str, Any]]): A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.
knowsAbout: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.
makesOffer: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to products or services offered by the organization or person.
ownershipFundingInfo: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.
founders: (Optional[Union[List[Union[str, Any]], str, Any]]): A person who founded this organization.
legalName: (Union[List[Union[str, Any]], str, Any]): The official name of the organization, e.g. the registered company name.
actionableFeedbackPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.
areaServed: (Union[List[Union[str, Any]], str, Any]): The geographic area where a service or offered item is provided.
parentOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): The larger organization that this organization is a [[subOrganization]] of, if any.
slogan: (Union[List[Union[str, Any]], str, Any]): A slogan or motto associated with the item.
department: (Optional[Union[List[Union[str, Any]], str, Any]]): A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
memberOf: (Optional[Union[List[Union[str, Any]], str, Any]]): An Organization (or ProgramMembership) to which this Person or Organization belongs.
publishingPrinciples: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]].While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.
employee: (Optional[Union[List[Union[str, Any]], str, Any]]): Someone working for this organization.
award: (Union[List[Union[str, Any]], str, Any]): An award won by or for this item.
email: (Union[List[Union[str, Any]], str, Any]): Email address.
contactPoints: (Optional[Union[List[Union[str, Any]], str, Any]]): A contact point for a person or organization.
diversityStaffingReport: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.
foundingDate: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): The date that this organization was founded.
owns: (Optional[Union[List[Union[str, Any]], str, Any]]): Products owned by the organization or person.
awards: (Union[List[Union[str, Any]], str, Any]): Awards won by or for this item.
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
dissolutionDate: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): The date that this organization was dissolved.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
interactionStatistic: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.
events: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past events associated with this place or organization.
seeks: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to products or services sought by the organization or person (demand).
employees: (Optional[Union[List[Union[str, Any]], str, Any]]): People working for this organization.
unnamedSourcesPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.
subOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific 'department' property.
foundingLocation: (Optional[Union[List[Union[str, Any]], str, Any]]): The place where the Organization was founded.
funder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports (sponsors) something through some kind of financial contribution.
iso6523Code: (Union[List[Union[str, Any]], str, Any]): An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly.
diversityPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.
hasMerchantReturnPolicy: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies a MerchantReturnPolicy that may be applicable.
event: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past event associated with this place, organization, or action.
duns: (Union[List[Union[str, Any]], str, Any]): The Dun & Bradstreet DUNS number for identifying an organization or business person.
alumni: (Optional[Union[List[Union[str, Any]], str, Any]]): Alumni of an organization.
ethicsPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.
leiCode: (Union[List[Union[str, Any]], str, Any]): An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.
vatID: (Union[List[Union[str, Any]], str, Any]): The Value-added Tax ID of the organization or person.
knowsLanguage: (Union[List[Union[str, Any]], str, Any]): Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).
correctionsPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.
logo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An associated logo.
hasCredential: (Optional[Union[List[Union[str, Any]], str, Any]]): A credential awarded to the Person or Organization.
address: (Union[List[Union[str, Any]], str, Any]): Physical address of the item.
brand: (Optional[Union[List[Union[str, Any]], str, Any]]): The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.
nonprofitStatus: (Optional[Union[List[Union[str, Any]], str, Any]]): nonprofitStatus indicates the legal status of a non-profit organization in its primary place of business.
contactPoint: (Optional[Union[List[Union[str, Any]], str, Any]]): A contact point for a person or organization.
hasOfferCatalog: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates an OfferCatalog listing for this Organization, Person, or Service.
members: (Optional[Union[List[Union[str, Any]], str, Any]]): A member of this organization.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
faxNumber: (Union[List[Union[str, Any]], str, Any]): The fax number.
telephone: (Union[List[Union[str, Any]], str, Any]): The telephone number.
taxID: (Union[List[Union[str, Any]], str, Any]): The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.
naics: (Union[List[Union[str, Any]], str, Any]): The North American Industry Classification System (NAICS) code for a particular organization or business person.
location: (Union[List[Union[str, Any]], str, Any]): The location of, for example, where an event is happening, where an organization is located, or where an action takes place.
numberOfEmployees: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of employees in an organization, e.g. business.
sponsor: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
geoCovers: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
longitude: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).
smokingAllowed: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.
isicV4: (Union[List[Union[str, Any]], str, Any]): The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.
globalLocationNumber: (Union[List[Union[str, Any]], str, Any]): The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.
amenityFeature: (Optional[Union[List[Union[str, Any]], str, Any]]): An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.
additionalProperty: (Optional[Union[List[Union[str, Any]], str, Any]]): A property-value pair representing an additional characteristic of the entity, e.g. a product feature or another characteristic for which there is no matching property in schema.org.Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.
slogan: (Union[List[Union[str, Any]], str, Any]): A slogan or motto associated with the item.
photos: (Optional[Union[List[Union[str, Any]], str, Any]]): Photographs of this place.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
tourBookingPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.
geoWithin: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
containsPlace: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and another that it contains.
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
hasMap: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
containedIn: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and one that contains it.
events: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past events associated with this place or organization.
geoOverlaps: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
geoEquals: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship).
maps: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
isAccessibleForFree: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the item, event, or place is accessible for free.
event: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past event associated with this place, organization, or action.
photo: (Optional[Union[List[Union[str, Any]], str, Any]]): A photograph of this place.
containedInPlace: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and one that contains it.
logo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An associated logo.
geoCrosses: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
address: (Union[List[Union[str, Any]], str, Any]): Physical address of the item.
geo: (Optional[Union[List[Union[str, Any]], str, Any]]): The geo coordinates of the place.
openingHoursSpecification: (Optional[Union[List[Union[str, Any]], str, Any]]): The opening hours of a certain place.
geoDisjoint: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: "they have no point in common. They form a set of disconnected geometries." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)
geoIntersects: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
latitude: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).
maximumAttendeeCapacity: (Optional[Union[List[Union[str, int, Any]], str, int, Any]]): The total number of individuals that may attend an event or venue.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
map: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
branchCode: (Union[List[Union[str, Any]], str, Any]): A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs.For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.
faxNumber: (Union[List[Union[str, Any]], str, Any]): The fax number.
publicAccess: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value
geoTouches: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) touch: "they have at least one boundary point in common, but no interior points." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)
geoCoveredBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
telephone: (Union[List[Union[str, Any]], str, Any]): The telephone number.
hasDriveThroughService: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.
specialOpeningHoursSpecification: (Optional[Union[List[Union[str, Any]], str, Any]]): The special opening hours of a certain place.Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]].
geoContains: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
priceRange: (Union[List[Union[str, Any]], str, Any]): The price range of the business, for example ```$$$```.
currenciesAccepted: (Union[List[Union[str, Any]], str, Any]): The currency accepted.Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217), e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types, e.g. "Ithaca HOUR".
branchOf: (Optional[Union[List[Union[str, Any]], str, Any]]): The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical) [[branch]].
paymentAccepted: (Union[List[Union[str, Any]], str, Any]): Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.
openingHours: (Union[List[Union[str, Any]], str, Any]): The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas ',' separating each day. Day or time ranges are specified using a hyphen '-'.* Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```.* Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: <code><time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays and Thursdays 4-8pm</time></code>.* If a business is open 7 days a week, then it can be specified as <code><time itemprop="openingHours" datetime="Mo-Su">Monday through Sunday, all day</time></code>.
"""
type_: str = Field(default="HealthAndBeautyBusiness", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
serviceArea: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The geographic area where the service is provided.",
)
founder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person who founded this organization.",
)
isicV4: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The International Standard of Industrial Classification of All Economic Activities"
"(ISIC), Revision 4 code for a particular organization, business person, or place.",
)
hasPOS: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Points-of-Sales operated by the organization or person.",
)
globalLocationNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred"
"to as International Location Number or ILN) of the respective organization, person,"
"or place. The GLN is a 13-digit number used to identify parties and physical locations.",
)
member: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A member of an Organization or a ProgramMembership. Organizations can be members of"
"organizations; ProgramMembership is typically for individuals.",
)
knowsAbout: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that"
"is known about - suggesting possible expertise but not implying it. We do not distinguish"
"skill levels here, or relate this to educational content, events, objectives or [[JobPosting]]"
"descriptions.",
)
makesOffer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to products or services offered by the organization or person.",
)
ownershipFundingInfo: Union[
List[Union[str, AnyUrl, Any]], str, AnyUrl, Any
] = Field(
default=None,
description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]),"
"a description of organizational ownership structure; funding and grants. In a news/media"
"setting, this is with particular reference to editorial independence. Note that the"
"[[funder]] is also available and can be used to make basic funder information machine-readable.",
)
founders: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person who founded this organization.",
)
legalName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The official name of the organization, e.g. the registered company name.",
)
actionableFeedbackPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement"
"about public engagement activities (for news media, the newsroom’s), including involving"
"the public - digitally or otherwise -- in coverage decisions, reporting and activities"
"after publication.",
)
areaServed: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The geographic area where a service or offered item is provided.",
)
parentOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The larger organization that this organization is a [[subOrganization]] of, if any.",
)
slogan: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A slogan or motto associated with the item.",
)
department: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A relationship between an organization and a department of that organization, also"
"described as an organization (allowing different urls, logos, opening hours). For"
"example: a store with a pharmacy, or a bakery with a cafe.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
memberOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An Organization (or ProgramMembership) to which this Person or Organization belongs.",
)
publishingPrinciples: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing"
"the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]]"
"writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity"
"policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles"
"are those of the party primarily responsible for the creation of the [[CreativeWork]].While"
"such policies are most typically expressed in natural language, sometimes related"
"information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.",
)
employee: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Someone working for this organization.",
)
award: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An award won by or for this item.",
)
email: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Email address.",
)
contactPoints: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A contact point for a person or organization.",
)
diversityStaffingReport: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]),"
"a report on staffing diversity issues. In a news context this might be for example ASNE"
"or RTDNA (US) reports, or self-reported.",
)
foundingDate: Optional[Union[List[Union[str, Any, date]], str, Any, date]] = Field(
default=None,
description="The date that this organization was founded.",
)
owns: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Products owned by the organization or person.",
)
awards: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Awards won by or for this item.",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
dissolutionDate: Optional[
Union[List[Union[str, Any, date]], str, Any, date]
] = Field(
default=None,
description="The date that this organization was dissolved.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
interactionStatistic: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication."
"The most specific child type of InteractionCounter should be used.",
)
events: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past events associated with this place or organization.",
)
seeks: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to products or services sought by the organization or person (demand).",
)
employees: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="People working for this organization.",
)
unnamedSourcesPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about"
"policy on use of unnamed sources and the decision process required.",
)
subOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A relationship between two organizations where the first includes the second, e.g.,"
"as a subsidiary. See also: the more specific 'department' property.",
)
foundingLocation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The place where the Organization was founded.",
)
funder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports (sponsors) something through some kind of financial"
"contribution.",
)
iso6523Code: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An organization identifier as defined in ISO 6523(-1). Note that many existing organization"
"identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns)"
"and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier"
"by setting the ICD part of the ISO 6523 identifier accordingly.",
)
diversityPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]."
"For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity"
"policy on both staffing and sources, typically providing staffing data.",
)
hasMerchantReturnPolicy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies a MerchantReturnPolicy that may be applicable.",
)
event: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past event associated with this place, organization, or action.",
)
duns: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Dun & Bradstreet DUNS number for identifying an organization or business person.",
)
alumni: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Alumni of an organization.",
)
ethicsPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic"
"and publishing practices, or of a [[Restaurant]], a page describing food source policies."
"In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement"
"describing the personal, organizational, and corporate standards of behavior expected"
"by the organization.",
)
leiCode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An organization identifier that uniquely identifies a legal entity as defined in ISO"
"17442.",
)
vatID: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Value-added Tax ID of the organization or person.",
)
knowsLanguage: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Of a [[Person]], and less typically of an [[Organization]], to indicate a known language."
"We do not distinguish skill levels or reading/writing/speaking/signing here. Use"
"language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).",
)
correctionsPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing"
"(in news media, the newsroom’s) disclosure and correction policy for errors.",
)
logo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An associated logo.",
)
hasCredential: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A credential awarded to the Person or Organization.",
)
address: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Physical address of the item.",
)
brand: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The brand(s) associated with a product or service, or the brand(s) maintained by an organization"
"or business person.",
)
nonprofitStatus: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="nonprofitStatus indicates the legal status of a non-profit organization in its primary"
"place of business.",
)
contactPoint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A contact point for a person or organization.",
)
hasOfferCatalog: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates an OfferCatalog listing for this Organization, Person, or Service.",
)
members: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A member of this organization.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
faxNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The fax number.",
)
telephone: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The telephone number.",
)
taxID: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in"
"Spain.",
)
naics: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The North American Industry Classification System (NAICS) code for a particular organization"
"or business person.",
)
location: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The location of, for example, where an event is happening, where an organization is located,"
"or where an action takes place.",
)
numberOfEmployees: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of employees in an organization, e.g. business.",
)
sponsor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports a thing through a pledge, promise, or financial"
"contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.",
)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
geoCovers: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a covering geometry to a covered geometry. "Every point of b is a point of (the interior'
'or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).',
)
longitude: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).",
)
smokingAllowed: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or"
"hotel room.",
)
isicV4: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The International Standard of Industrial Classification of All Economic Activities"
"(ISIC), Revision 4 code for a particular organization, business person, or place.",
)
globalLocationNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred"
"to as International Location Number or ILN) of the respective organization, person,"
"or place. The GLN is a 13-digit number used to identify parties and physical locations.",
)
amenityFeature: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic"
"property does not make a statement about whether the feature is included in an offer for"
"the main accommodation or available at extra costs.",
)
additionalProperty: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A property-value pair representing an additional characteristic of the entity, e.g."
"a product feature or another characteristic for which there is no matching property"
"in schema.org.Note: Publishers should be aware that applications designed to use specific"
"schema.org properties (e.g. https://schema.org/width, https://schema.org/color,"
"https://schema.org/gtin13, ...) will typically expect such data to be provided using"
"those properties, rather than using the generic property/value mechanism.",
)
slogan: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A slogan or motto associated with the item.",
)
photos: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Photographs of this place.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
tourBookingPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]]"
"or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.",
)
geoWithin: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined"
"in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
containsPlace: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and another that it contains.",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
hasMap: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
containedIn: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and one that contains it.",
)
events: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past events associated with this place or organization.",
)
geoOverlaps: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to another that geospatially overlaps it, i.e. they have some but not all points"
"in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
geoEquals: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
"are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM)."
'"Two geometries are topologically equal if their interiors intersect and no part of'
'the interior or boundary of one geometry intersects the exterior of the other" (a symmetric'
"relationship).",
)
maps: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
isAccessibleForFree: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the item, event, or place is accessible for free.",
)
event: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past event associated with this place, organization, or action.",
)
photo: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A photograph of this place.",
)
containedInPlace: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and one that contains it.",
)
logo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An associated logo.",
)
geoCrosses: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a geometry to another that crosses it: "a crosses b: they have some but not all interior'
"points in common, and the dimension of the intersection is less than that of at least one"
'of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).',
)
address: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Physical address of the item.",
)
geo: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The geo coordinates of the place.",
)
openingHoursSpecification: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The opening hours of a certain place.",
)
geoDisjoint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
'are topologically disjoint: "they have no point in common. They form a set of disconnected'
'geometries." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)',
)
geoIntersects: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
"have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
latitude: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).",
)
maximumAttendeeCapacity: Optional[
Union[List[Union[str, int, Any]], str, int, Any]
] = Field(
default=None,
description="The total number of individuals that may attend an event or venue.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
map: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
branchCode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description='A short textual code (also called "store code") that uniquely identifies a place of'
"business. The code is typically assigned by the parentOrganization and used in structured"
"URLs.For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047"
'the code "3047" is a branchCode for a particular branch.',
)
faxNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The fax number.",
)
publicAccess: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the [[Place]] is open to public visitors. If this property is omitted"
"there is no assumed default boolean value",
)
geoTouches: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
'touch: "they have at least one boundary point in common, but no interior points." (A'
"symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)",
)
geoCoveredBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
telephone: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The telephone number.",
)
hasDriveThroughService: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]])"
"offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]]"
"such facilities could potentially help with social distancing from other potentially-infected"
"users.",
)
specialOpeningHoursSpecification: Optional[
Union[List[Union[str, Any]], str, Any]
] = Field(
default=None,
description="The special opening hours of a certain place.Use this to explicitly override general"
"opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]].",
)
geoContains: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a containing geometry to a contained geometry. "a contains b iff no points of b lie in'
'the exterior of a, and at least one point of the interior of b lies in the interior of a".'
"As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
priceRange: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The price range of the business, for example ```$$$```.",
)
currenciesAccepted: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The currency accepted.Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217),"
'e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies)'
'for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system)'
'(LETS) and other currency types, e.g. "Ithaca HOUR".',
)
branchOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The larger organization that this local business is a branch of, if any. Not to be confused"
"with (anatomical) [[branch]].",
)
paymentAccepted: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.",
)
openingHours: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The general opening hours for a business. Opening hours can be specified as a weekly time"
"range, starting with days, then times per day. Multiple days can be listed with commas"
"',' separating each day. Day or time ranges are specified using a hyphen '-'.* Days are"
"specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```,"
"```Th```, ```Fr```, ```Sa```, ```Su```.* Times are specified using 24:00 format."
"For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example:"
'<code><time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays'
"and Thursdays 4-8pm</time></code>.* If a business is open 7 days a week, then"
"it can be specified as <code><time itemprop="openingHours" datetime="Mo-Su">Monday"
"through Sunday, all day</time></code>.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/HealthAndBeautyBusiness.py
| 0.882927 | 0.327473 |
HealthAndBeautyBusiness.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class WearableSizeGroupMens(BaseModel):
"""Size group "Mens" for wearables.
References:
https://schema.org/WearableSizeGroupMens
Note:
Model Depth 6
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
supersededBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Relates a term (i.e. a property, class or enumeration) to one that supersedes it.
"""
type_: str = Field(default="WearableSizeGroupMens", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
supersededBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/WearableSizeGroupMens.py
| 0.943021 | 0.293177 |
WearableSizeGroupMens.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class MedicalProcedure(BaseModel):
"""A process of care used in either a diagnostic, therapeutic, preventive or palliative capacity that relies on invasive (surgical), non-invasive, or other techniques.
References:
https://schema.org/MedicalProcedure
Note:
Model Depth 3
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
recognizingAuthority: (Optional[Union[List[Union[str, Any]], str, Any]]): If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.
relevantSpecialty: (Optional[Union[List[Union[str, Any]], str, Any]]): If applicable, a medical specialty in which this entity is relevant.
medicineSystem: (Optional[Union[List[Union[str, Any]], str, Any]]): The system of medicine that includes this MedicalEntity, for example 'evidence-based', 'homeopathic', 'chiropractic', etc.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
legalStatus: (Union[List[Union[str, Any]], str, Any]): The drug or supplement's legal status, including any controlled substance schedules that apply.
study: (Optional[Union[List[Union[str, Any]], str, Any]]): A medical study or trial related to this entity.
guideline: (Optional[Union[List[Union[str, Any]], str, Any]]): A medical guideline related to this entity.
code: (Optional[Union[List[Union[str, Any]], str, Any]]): A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.
howPerformed: (Union[List[Union[str, Any]], str, Any]): How the procedure is performed.
procedureType: (Optional[Union[List[Union[str, Any]], str, Any]]): The type of procedure, for example Surgical, Noninvasive, or Percutaneous.
status: (Union[List[Union[str, Any]], str, Any]): The status of the study (enumerated).
bodyLocation: (Union[List[Union[str, Any]], str, Any]): Location in the body of the anatomical structure.
followup: (Union[List[Union[str, Any]], str, Any]): Typical or recommended followup care after the procedure is performed.
preparation: (Union[List[Union[str, Any]], str, Any]): Typical preparation that a patient must undergo before having the procedure performed.
"""
type_: str = Field(default="MedicalProcedure", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
recognizingAuthority: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="If applicable, the organization that officially recognizes this entity as part of its"
"endorsed system of medicine.",
)
relevantSpecialty: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="If applicable, a medical specialty in which this entity is relevant.",
)
medicineSystem: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The system of medicine that includes this MedicalEntity, for example 'evidence-based',"
"'homeopathic', 'chiropractic', etc.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
legalStatus: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The drug or supplement's legal status, including any controlled substance schedules"
"that apply.",
)
study: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A medical study or trial related to this entity.",
)
guideline: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A medical guideline related to this entity.",
)
code: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A medical code for the entity, taken from a controlled vocabulary or ontology such as"
"ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.",
)
howPerformed: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="How the procedure is performed.",
)
procedureType: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The type of procedure, for example Surgical, Noninvasive, or Percutaneous.",
)
status: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The status of the study (enumerated).",
)
bodyLocation: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Location in the body of the anatomical structure.",
)
followup: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Typical or recommended followup care after the procedure is performed.",
)
preparation: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Typical preparation that a patient must undergo before having the procedure performed.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/MedicalProcedure.py
| 0.930829 | 0.372049 |
MedicalProcedure.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class WearableSizeGroupExtraTall(BaseModel):
"""Size group "Extra Tall" for wearables.
References:
https://schema.org/WearableSizeGroupExtraTall
Note:
Model Depth 6
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
supersededBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Relates a term (i.e. a property, class or enumeration) to one that supersedes it.
"""
type_: str = Field(default="WearableSizeGroupExtraTall", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
supersededBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/WearableSizeGroupExtraTall.py
| 0.941641 | 0.290386 |
WearableSizeGroupExtraTall.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class NGO(BaseModel):
"""Organization: Non-governmental Organization.
References:
https://schema.org/NGO
Note:
Model Depth 3
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
serviceArea: (Optional[Union[List[Union[str, Any]], str, Any]]): The geographic area where the service is provided.
founder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person who founded this organization.
isicV4: (Union[List[Union[str, Any]], str, Any]): The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.
hasPOS: (Optional[Union[List[Union[str, Any]], str, Any]]): Points-of-Sales operated by the organization or person.
globalLocationNumber: (Union[List[Union[str, Any]], str, Any]): The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.
member: (Optional[Union[List[Union[str, Any]], str, Any]]): A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.
knowsAbout: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.
makesOffer: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to products or services offered by the organization or person.
ownershipFundingInfo: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.
founders: (Optional[Union[List[Union[str, Any]], str, Any]]): A person who founded this organization.
legalName: (Union[List[Union[str, Any]], str, Any]): The official name of the organization, e.g. the registered company name.
actionableFeedbackPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.
areaServed: (Union[List[Union[str, Any]], str, Any]): The geographic area where a service or offered item is provided.
parentOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): The larger organization that this organization is a [[subOrganization]] of, if any.
slogan: (Union[List[Union[str, Any]], str, Any]): A slogan or motto associated with the item.
department: (Optional[Union[List[Union[str, Any]], str, Any]]): A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
memberOf: (Optional[Union[List[Union[str, Any]], str, Any]]): An Organization (or ProgramMembership) to which this Person or Organization belongs.
publishingPrinciples: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]].While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.
employee: (Optional[Union[List[Union[str, Any]], str, Any]]): Someone working for this organization.
award: (Union[List[Union[str, Any]], str, Any]): An award won by or for this item.
email: (Union[List[Union[str, Any]], str, Any]): Email address.
contactPoints: (Optional[Union[List[Union[str, Any]], str, Any]]): A contact point for a person or organization.
diversityStaffingReport: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.
foundingDate: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): The date that this organization was founded.
owns: (Optional[Union[List[Union[str, Any]], str, Any]]): Products owned by the organization or person.
awards: (Union[List[Union[str, Any]], str, Any]): Awards won by or for this item.
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
dissolutionDate: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): The date that this organization was dissolved.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
interactionStatistic: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.
events: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past events associated with this place or organization.
seeks: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to products or services sought by the organization or person (demand).
employees: (Optional[Union[List[Union[str, Any]], str, Any]]): People working for this organization.
unnamedSourcesPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.
subOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific 'department' property.
foundingLocation: (Optional[Union[List[Union[str, Any]], str, Any]]): The place where the Organization was founded.
funder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports (sponsors) something through some kind of financial contribution.
iso6523Code: (Union[List[Union[str, Any]], str, Any]): An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly.
diversityPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.
hasMerchantReturnPolicy: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies a MerchantReturnPolicy that may be applicable.
event: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past event associated with this place, organization, or action.
duns: (Union[List[Union[str, Any]], str, Any]): The Dun & Bradstreet DUNS number for identifying an organization or business person.
alumni: (Optional[Union[List[Union[str, Any]], str, Any]]): Alumni of an organization.
ethicsPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.
leiCode: (Union[List[Union[str, Any]], str, Any]): An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.
vatID: (Union[List[Union[str, Any]], str, Any]): The Value-added Tax ID of the organization or person.
knowsLanguage: (Union[List[Union[str, Any]], str, Any]): Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).
correctionsPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.
logo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An associated logo.
hasCredential: (Optional[Union[List[Union[str, Any]], str, Any]]): A credential awarded to the Person or Organization.
address: (Union[List[Union[str, Any]], str, Any]): Physical address of the item.
brand: (Optional[Union[List[Union[str, Any]], str, Any]]): The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.
nonprofitStatus: (Optional[Union[List[Union[str, Any]], str, Any]]): nonprofitStatus indicates the legal status of a non-profit organization in its primary place of business.
contactPoint: (Optional[Union[List[Union[str, Any]], str, Any]]): A contact point for a person or organization.
hasOfferCatalog: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates an OfferCatalog listing for this Organization, Person, or Service.
members: (Optional[Union[List[Union[str, Any]], str, Any]]): A member of this organization.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
faxNumber: (Union[List[Union[str, Any]], str, Any]): The fax number.
telephone: (Union[List[Union[str, Any]], str, Any]): The telephone number.
taxID: (Union[List[Union[str, Any]], str, Any]): The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.
naics: (Union[List[Union[str, Any]], str, Any]): The North American Industry Classification System (NAICS) code for a particular organization or business person.
location: (Union[List[Union[str, Any]], str, Any]): The location of, for example, where an event is happening, where an organization is located, or where an action takes place.
numberOfEmployees: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of employees in an organization, e.g. business.
sponsor: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.
"""
type_: str = Field(default="NGO", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
serviceArea: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The geographic area where the service is provided.",
)
founder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person who founded this organization.",
)
isicV4: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The International Standard of Industrial Classification of All Economic Activities"
"(ISIC), Revision 4 code for a particular organization, business person, or place.",
)
hasPOS: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Points-of-Sales operated by the organization or person.",
)
globalLocationNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred"
"to as International Location Number or ILN) of the respective organization, person,"
"or place. The GLN is a 13-digit number used to identify parties and physical locations.",
)
member: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A member of an Organization or a ProgramMembership. Organizations can be members of"
"organizations; ProgramMembership is typically for individuals.",
)
knowsAbout: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that"
"is known about - suggesting possible expertise but not implying it. We do not distinguish"
"skill levels here, or relate this to educational content, events, objectives or [[JobPosting]]"
"descriptions.",
)
makesOffer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to products or services offered by the organization or person.",
)
ownershipFundingInfo: Union[
List[Union[str, AnyUrl, Any]], str, AnyUrl, Any
] = Field(
default=None,
description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]),"
"a description of organizational ownership structure; funding and grants. In a news/media"
"setting, this is with particular reference to editorial independence. Note that the"
"[[funder]] is also available and can be used to make basic funder information machine-readable.",
)
founders: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person who founded this organization.",
)
legalName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The official name of the organization, e.g. the registered company name.",
)
actionableFeedbackPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement"
"about public engagement activities (for news media, the newsroom’s), including involving"
"the public - digitally or otherwise -- in coverage decisions, reporting and activities"
"after publication.",
)
areaServed: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The geographic area where a service or offered item is provided.",
)
parentOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The larger organization that this organization is a [[subOrganization]] of, if any.",
)
slogan: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A slogan or motto associated with the item.",
)
department: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A relationship between an organization and a department of that organization, also"
"described as an organization (allowing different urls, logos, opening hours). For"
"example: a store with a pharmacy, or a bakery with a cafe.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
memberOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An Organization (or ProgramMembership) to which this Person or Organization belongs.",
)
publishingPrinciples: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing"
"the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]]"
"writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity"
"policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles"
"are those of the party primarily responsible for the creation of the [[CreativeWork]].While"
"such policies are most typically expressed in natural language, sometimes related"
"information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.",
)
employee: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Someone working for this organization.",
)
award: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An award won by or for this item.",
)
email: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Email address.",
)
contactPoints: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A contact point for a person or organization.",
)
diversityStaffingReport: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]),"
"a report on staffing diversity issues. In a news context this might be for example ASNE"
"or RTDNA (US) reports, or self-reported.",
)
foundingDate: Optional[Union[List[Union[str, Any, date]], str, Any, date]] = Field(
default=None,
description="The date that this organization was founded.",
)
owns: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Products owned by the organization or person.",
)
awards: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Awards won by or for this item.",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
dissolutionDate: Optional[
Union[List[Union[str, Any, date]], str, Any, date]
] = Field(
default=None,
description="The date that this organization was dissolved.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
interactionStatistic: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication."
"The most specific child type of InteractionCounter should be used.",
)
events: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past events associated with this place or organization.",
)
seeks: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to products or services sought by the organization or person (demand).",
)
employees: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="People working for this organization.",
)
unnamedSourcesPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about"
"policy on use of unnamed sources and the decision process required.",
)
subOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A relationship between two organizations where the first includes the second, e.g.,"
"as a subsidiary. See also: the more specific 'department' property.",
)
foundingLocation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The place where the Organization was founded.",
)
funder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports (sponsors) something through some kind of financial"
"contribution.",
)
iso6523Code: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An organization identifier as defined in ISO 6523(-1). Note that many existing organization"
"identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns)"
"and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier"
"by setting the ICD part of the ISO 6523 identifier accordingly.",
)
diversityPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]."
"For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity"
"policy on both staffing and sources, typically providing staffing data.",
)
hasMerchantReturnPolicy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies a MerchantReturnPolicy that may be applicable.",
)
event: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past event associated with this place, organization, or action.",
)
duns: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Dun & Bradstreet DUNS number for identifying an organization or business person.",
)
alumni: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Alumni of an organization.",
)
ethicsPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic"
"and publishing practices, or of a [[Restaurant]], a page describing food source policies."
"In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement"
"describing the personal, organizational, and corporate standards of behavior expected"
"by the organization.",
)
leiCode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An organization identifier that uniquely identifies a legal entity as defined in ISO"
"17442.",
)
vatID: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Value-added Tax ID of the organization or person.",
)
knowsLanguage: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Of a [[Person]], and less typically of an [[Organization]], to indicate a known language."
"We do not distinguish skill levels or reading/writing/speaking/signing here. Use"
"language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).",
)
correctionsPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing"
"(in news media, the newsroom’s) disclosure and correction policy for errors.",
)
logo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An associated logo.",
)
hasCredential: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A credential awarded to the Person or Organization.",
)
address: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Physical address of the item.",
)
brand: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The brand(s) associated with a product or service, or the brand(s) maintained by an organization"
"or business person.",
)
nonprofitStatus: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="nonprofitStatus indicates the legal status of a non-profit organization in its primary"
"place of business.",
)
contactPoint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A contact point for a person or organization.",
)
hasOfferCatalog: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates an OfferCatalog listing for this Organization, Person, or Service.",
)
members: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A member of this organization.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
faxNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The fax number.",
)
telephone: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The telephone number.",
)
taxID: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in"
"Spain.",
)
naics: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The North American Industry Classification System (NAICS) code for a particular organization"
"or business person.",
)
location: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The location of, for example, where an event is happening, where an organization is located,"
"or where an action takes place.",
)
numberOfEmployees: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of employees in an organization, e.g. business.",
)
sponsor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports a thing through a pledge, promise, or financial"
"contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/NGO.py
| 0.876872 | 0.359898 |
NGO.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class Paperback(BaseModel):
"""Book format: Paperback.
References:
https://schema.org/Paperback
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
supersededBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Relates a term (i.e. a property, class or enumeration) to one that supersedes it.
"""
type_: str = Field(default="Paperback", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
supersededBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/Paperback.py
| 0.941358 | 0.287205 |
Paperback.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class CreateAction(BaseModel):
"""The act of deliberately creating/producing/generating/building a result out of the agent.
References:
https://schema.org/CreateAction
Note:
Model Depth 3
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
endTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. E.g. John wrote a book from January to *December*. For media, including audio and video, it's the time offset of the end of a clip within a larger file.Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.
provider: (Optional[Union[List[Union[str, Any]], str, Any]]): The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller.
startTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. E.g. John wrote a book from *January* to December. For media, including audio and video, it's the time offset of the start of a clip within a larger file.Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.
result: (Optional[Union[List[Union[str, Any]], str, Any]]): The result produced in the action. E.g. John wrote *a book*.
actionStatus: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the current disposition of the Action.
agent: (Optional[Union[List[Union[str, Any]], str, Any]]): The direct performer or driver of the action (animate or inanimate). E.g. *John* wrote a book.
instrument: (Optional[Union[List[Union[str, Any]], str, Any]]): The object that helped the agent perform the action. E.g. John wrote a book with *a pen*.
object: (Optional[Union[List[Union[str, Any]], str, Any]]): The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn't). E.g. John read *a book*.
error: (Optional[Union[List[Union[str, Any]], str, Any]]): For failed actions, more information on the cause of the failure.
target: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a target EntryPoint, or url, for an Action.
location: (Union[List[Union[str, Any]], str, Any]): The location of, for example, where an event is happening, where an organization is located, or where an action takes place.
participant: (Optional[Union[List[Union[str, Any]], str, Any]]): Other co-agents that participated in the action indirectly. E.g. John wrote a book with *Steve*.
"""
type_: str = Field(default="CreateAction", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
endTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation),"
"the time that it is expected to end. For actions that span a period of time, when the action"
"was performed. E.g. John wrote a book from January to *December*. For media, including"
"audio and video, it's the time offset of the end of a clip within a larger file.Note that"
"Event uses startDate/endDate instead of startTime/endTime, even when describing"
"dates with times. This situation may be clarified in future revisions.",
)
provider: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The service provider, service operator, or service performer; the goods producer."
"Another party (a seller) may offer those services or goods on behalf of the provider."
"A provider may also serve as the seller.",
)
startTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation),"
"the time that it is expected to start. For actions that span a period of time, when the action"
"was performed. E.g. John wrote a book from *January* to December. For media, including"
"audio and video, it's the time offset of the start of a clip within a larger file.Note that"
"Event uses startDate/endDate instead of startTime/endTime, even when describing"
"dates with times. This situation may be clarified in future revisions.",
)
result: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The result produced in the action. E.g. John wrote *a book*.",
)
actionStatus: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the current disposition of the Action.",
)
agent: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The direct performer or driver of the action (animate or inanimate). E.g. *John* wrote"
"a book.",
)
instrument: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The object that helped the agent perform the action. E.g. John wrote a book with *a pen*.",
)
object: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The object upon which the action is carried out, whose state is kept intact or changed."
"Also known as the semantic roles patient, affected or undergoer (which change their"
"state) or theme (which doesn't). E.g. John read *a book*.",
)
error: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="For failed actions, more information on the cause of the failure.",
)
target: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="Indicates a target EntryPoint, or url, for an Action.",
)
location: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The location of, for example, where an event is happening, where an organization is located,"
"or where an action takes place.",
)
participant: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Other co-agents that participated in the action indirectly. E.g. John wrote a book with"
"*Steve*.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/CreateAction.py
| 0.928206 | 0.444625 |
CreateAction.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class Table(BaseModel):
"""A table on a Web page.
References:
https://schema.org/Table
Note:
Model Depth 4
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
workTranslation: (Optional[Union[List[Union[str, Any]], str, Any]]): A work that is a translation of the content of this work. E.g. 西遊記 has an English workTranslation “Journey to the West”, a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.
educationalLevel: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The level in terms of progression through an educational or training context. Examples of educational levels include 'beginner', 'intermediate' or 'advanced', and formal sets of level indicators.
associatedMedia: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork. This property is a synonym for encoding.
exampleOfWork: (Optional[Union[List[Union[str, Any]], str, Any]]): A creative work that this work is an example/instance/realization/derivation of.
releasedEvent: (Optional[Union[List[Union[str, Any]], str, Any]]): The place and time the release was issued, expressed as a PublicationEvent.
version: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The version of the CreativeWork embodied by a specified resource.
locationCreated: (Optional[Union[List[Union[str, Any]], str, Any]]): The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.
acquireLicensePage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.
thumbnailUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A thumbnail image relevant to the Thing.
provider: (Optional[Union[List[Union[str, Any]], str, Any]]): The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller.
expires: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.
contentLocation: (Optional[Union[List[Union[str, Any]], str, Any]]): The location depicted or described in the content. For example, the location in a photograph or painting.
educationalUse: (Union[List[Union[str, Any]], str, Any]): The purpose of a work in the context of education; for example, 'assignment', 'group work'.
copyrightHolder: (Optional[Union[List[Union[str, Any]], str, Any]]): The party holding the legal copyright to the CreativeWork.
accessibilityControl: (Union[List[Union[str, Any]], str, Any]): Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).
maintainer: (Optional[Union[List[Union[str, Any]], str, Any]]): A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.
educationalAlignment: (Optional[Union[List[Union[str, Any]], str, Any]]): An alignment to an established educational framework.This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.
spatial: (Optional[Union[List[Union[str, Any]], str, Any]]): The "spatial" property can be used in cases when more specific properties(e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.
publisher: (Optional[Union[List[Union[str, Any]], str, Any]]): The publisher of the creative work.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
assesses: (Union[List[Union[str, Any]], str, Any]): The item being described is intended to assess the competency or learning outcome defined by the referenced term.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
isBasedOn: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A resource from which this work is derived or from which it is a modification or adaption.
mentions: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.
publishingPrinciples: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]].While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.
contributor: (Optional[Union[List[Union[str, Any]], str, Any]]): A secondary contributor to the CreativeWork or Event.
license: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A license document that applies to this content, typically indicated by URL.
citation: (Union[List[Union[str, Any]], str, Any]): A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.
accessibilitySummary: (Union[List[Union[str, Any]], str, Any]): A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."
award: (Union[List[Union[str, Any]], str, Any]): An award won by or for this item.
commentCount: (Optional[Union[List[Union[str, int, Any]], str, int, Any]]): The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.
temporalCoverage: (Union[List[Union[datetime, str, Any, AnyUrl]], datetime, str, Any, AnyUrl]): The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content, e.g. ScholarlyArticle, Book, TVSeries or TVEpisode, may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945".Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.
dateCreated: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date on which the CreativeWork was created or the item was added to a DataFeed.
discussionUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A link to the page containing the comments of the CreativeWork.
copyrightNotice: (Union[List[Union[str, Any]], str, Any]): Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.
learningResourceType: (Union[List[Union[str, Any]], str, Any]): The predominant type or kind characterizing the learning resource. For example, 'presentation', 'handout'.
awards: (Union[List[Union[str, Any]], str, Any]): Awards won by or for this item.
accessModeSufficient: (Optional[Union[List[Union[str, Any]], str, Any]]): A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
conditionsOfAccess: (Union[List[Union[str, Any]], str, Any]): Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language.For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".
interactivityType: (Union[List[Union[str, Any]], str, Any]): The predominant mode of learning supported by the learning resource. Acceptable values are 'active', 'expositive', or 'mixed'.
abstract: (Union[List[Union[str, Any]], str, Any]): An abstract is a short description that summarizes a [[CreativeWork]].
fileFormat: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content, e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, 'encoding' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.
interpretedAsClaim: (Optional[Union[List[Union[str, Any]], str, Any]]): Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].
text: (Union[List[Union[str, Any]], str, Any]): The textual content of this CreativeWork.
archivedAt: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.
alternativeHeadline: (Union[List[Union[str, Any]], str, Any]): A secondary title of the CreativeWork.
creditText: (Union[List[Union[str, Any]], str, Any]): Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
interactionStatistic: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.
workExample: (Optional[Union[List[Union[str, Any]], str, Any]]): Example/instance/realization/derivation of the concept of this creative work. E.g. the paperback edition, first edition, or e-book.
about: (Optional[Union[List[Union[str, Any]], str, Any]]): The subject matter of the content.
encodings: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork.
funder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports (sponsors) something through some kind of financial contribution.
video: (Optional[Union[List[Union[str, Any]], str, Any]]): An embedded video object.
isPartOf: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.
pattern: (Union[List[Union[str, Any]], str, Any]): A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'. Values are typically expressed as text, although links to controlled value schemes are also supported.
editor: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the Person who edited the CreativeWork.
dateModified: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date on which the CreativeWork was most recently modified or when the item's entry was modified within a DataFeed.
translationOfWork: (Optional[Union[List[Union[str, Any]], str, Any]]): The work that this work has been translated from. E.g. 物种起源 is a translationOf “On the Origin of Species”.
creativeWorkStatus: (Union[List[Union[str, Any]], str, Any]): The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.
isBasedOnUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.
isFamilyFriendly: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether this content is family friendly.
isAccessibleForFree: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the item, event, or place is accessible for free.
author: (Optional[Union[List[Union[str, Any]], str, Any]]): The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.
contentReferenceTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.
correction: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.
sdDatePublished: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]
comment: (Optional[Union[List[Union[str, Any]], str, Any]]): Comments, typically from users.
countryOfOrigin: (Optional[Union[List[Union[str, Any]], str, Any]]): The country of origin of something, including products as well as creative works such as movie and TV content.In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable.In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.
timeRequired: (Optional[Union[List[Union[str, Any]], str, Any]]): Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.
typicalAgeRange: (Union[List[Union[str, Any]], str, Any]): The typical expected age range, e.g. '7-9', '11-'.
genre: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Genre of the creative work, broadcast channel or group.
producer: (Optional[Union[List[Union[str, Any]], str, Any]]): The person or organization who produced the work (e.g. music album, movie, TV/radio series etc.).
schemaVersion: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.
audience: (Optional[Union[List[Union[str, Any]], str, Any]]): An intended audience, i.e. a group for whom something was created.
encoding: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.
publisherImprint: (Optional[Union[List[Union[str, Any]], str, Any]]): The publishing division which published the comic.
accessibilityAPI: (Union[List[Union[str, Any]], str, Any]): Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).
sdPublisher: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The[[sdPublisher]] property helps make such practices more explicit.
audio: (Optional[Union[List[Union[str, Any]], str, Any]]): An embedded audio object.
accessibilityFeature: (Union[List[Union[str, Any]], str, Any]): Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).
spatialCoverage: (Optional[Union[List[Union[str, Any]], str, Any]]): The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.
accessMode: (Union[List[Union[str, Any]], str, Any]): The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).
editEIDR: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television.For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J" has several edits, e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3".Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description.
usageInfo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information, e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options.This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.
position: (Union[List[Union[str, int, Any]], str, int, Any]): The position of an item in a series or sequence of items.
encodingFormat: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)), e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information.Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.
copyrightYear: (Optional[Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]]): The year during which the claimed copyright for the CreativeWork was first asserted.
mainEntity: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the primary entity described in some page or other CreativeWork.
creator: (Optional[Union[List[Union[str, Any]], str, Any]]): The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.
teaches: (Union[List[Union[str, Any]], str, Any]): The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.
temporal: (Union[List[Union[datetime, str, Any]], datetime, str, Any]): The "temporal" property can be used in cases where more specific properties(e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.
size: (Union[List[Union[str, Any]], str, Any]): A standardized size of a product or creative work, specified either through a simple textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable.
translator: (Optional[Union[List[Union[str, Any]], str, Any]]): Organization or person who adapts a creative work to different languages, regional differences and technical requirements of a target market, or that translates during some event.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
accountablePerson: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the Person that is legally accountable for the CreativeWork.
accessibilityHazard: (Union[List[Union[str, Any]], str, Any]): A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).
contentRating: (Union[List[Union[str, Any]], str, Any]): Official rating of a piece of content—for example, 'MPAA PG-13'.
recordedAt: (Optional[Union[List[Union[str, Any]], str, Any]]): The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.
publication: (Optional[Union[List[Union[str, Any]], str, Any]]): A publication event associated with the item.
sdLicense: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A license document that applies to this structured data, typically indicated by URL.
headline: (Union[List[Union[str, Any]], str, Any]): Headline of the article.
materialExtent: (Union[List[Union[str, Any]], str, Any]): The quantity of the materials being described or an expression of the physical space they occupy.
inLanguage: (Union[List[Union[str, Any]], str, Any]): The language of the content or performance or used in an action. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[availableLanguage]].
material: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): A material that something is made from, e.g. leather, wool, cotton, paper.
datePublished: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): Date of first broadcast/publication.
offers: (Optional[Union[List[Union[str, Any]], str, Any]]): An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]] to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can also be used to describe a [[Demand]]. While this property is listed as expected on a number of common types, it can be used in others. In that case, using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.
hasPart: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).
sourceOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): The Organization on whose behalf the creator was working.
sponsor: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.
character: (Optional[Union[List[Union[str, Any]], str, Any]]): Fictional person connected with a creative work.
xpath: (Union[List[Union[str, Any]], str, Any]): An XPath, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".
cssSelector: (Union[List[Union[str, Any]], str, Any]): A CSS selector, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter case, multiple matches within a page can constitute a single conceptual "Web page element".
"""
type_: str = Field(default="Table", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
workTranslation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A work that is a translation of the content of this work. E.g. 西遊記 has an English workTranslation"
"“Journey to the West”, a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese"
"translation Tây du ký bình khảo.",
)
educationalLevel: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The level in terms of progression through an educational or training context. Examples"
"of educational levels include 'beginner', 'intermediate' or 'advanced', and formal"
"sets of level indicators.",
)
associatedMedia: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork. This property is a synonym for encoding.",
)
exampleOfWork: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A creative work that this work is an example/instance/realization/derivation of.",
)
releasedEvent: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The place and time the release was issued, expressed as a PublicationEvent.",
)
version: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The version of the CreativeWork embodied by a specified resource.",
)
locationCreated: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The location where the CreativeWork was created, which may not be the same as the location"
"depicted in the CreativeWork.",
)
acquireLicensePage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page documenting how licenses can be purchased or otherwise acquired, for"
"the current item.",
)
thumbnailUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A thumbnail image relevant to the Thing.",
)
provider: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The service provider, service operator, or service performer; the goods producer."
"Another party (a seller) may offer those services or goods on behalf of the provider."
"A provider may also serve as the seller.",
)
expires: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="Date the content expires and is no longer useful or available. For example a [[VideoObject]]"
"or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]]"
"fact check whose publisher wants to indicate that it may no longer be relevant (or helpful"
"to highlight) after some date.",
)
contentLocation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The location depicted or described in the content. For example, the location in a photograph"
"or painting.",
)
educationalUse: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The purpose of a work in the context of education; for example, 'assignment', 'group"
"work'.",
)
copyrightHolder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The party holding the legal copyright to the CreativeWork.",
)
accessibilityControl: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Identifies input methods that are sufficient to fully control the described resource."
"Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).",
)
maintainer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other"
"[[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions"
"to, and/or publication of, some (typically complex) artifact. It is common for distributions"
'of software and data to be based on "upstream" sources. When [[maintainer]] is applied'
"to a specific version of something e.g. a particular version or packaging of a [[Dataset]],"
"it is always possible that the upstream source has a different maintainer. The [[isBasedOn]]"
"property can be used to indicate such relationships between datasets to make the different"
"maintenance roles clear. Similarly in the case of software, a package may have dedicated"
"maintainers working on integration into software distributions such as Ubuntu, as"
"well as upstream maintainers of the underlying work.",
)
educationalAlignment: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An alignment to an established educational framework.This property should not be used"
"where the nature of the alignment can be described using a simple property, for example"
"to express that a resource [[teaches]] or [[assesses]] a competency.",
)
spatial: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description='The "spatial" property can be used in cases when more specific properties(e.g. [[locationCreated]],'
"[[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.",
)
publisher: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The publisher of the creative work.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
assesses: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The item being described is intended to assess the competency or learning outcome defined"
"by the referenced term.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
isBasedOn: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A resource from which this work is derived or from which it is a modification or adaption.",
)
mentions: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates that the CreativeWork contains a reference to, but is not necessarily about"
"a concept.",
)
publishingPrinciples: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing"
"the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]]"
"writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity"
"policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles"
"are those of the party primarily responsible for the creation of the [[CreativeWork]].While"
"such policies are most typically expressed in natural language, sometimes related"
"information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.",
)
contributor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A secondary contributor to the CreativeWork or Event.",
)
license: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A license document that applies to this content, typically indicated by URL.",
)
citation: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A citation or reference to another creative work, such as another publication, web page,"
"scholarly article, etc.",
)
accessibilitySummary: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A human-readable summary of specific accessibility features or deficiencies, consistent"
'with the other accessibility metadata but expressing subtleties such as "short descriptions'
'are present but long descriptions will be needed for non-visual users" or "short descriptions'
'are present and no long descriptions are needed."',
)
award: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An award won by or for this item.",
)
commentCount: Optional[Union[List[Union[str, int, Any]], str, int, Any]] = Field(
default=None,
description="The number of comments this CreativeWork (e.g. Article, Question or Answer) has received."
"This is most applicable to works published in Web sites with commenting system; additional"
"comments may exist elsewhere.",
)
temporalCoverage: Union[
List[Union[datetime, str, Any, AnyUrl]], datetime, str, Any, AnyUrl
] = Field(
default=None,
description="The temporalCoverage of a CreativeWork indicates the period that the content applies"
"to, i.e. that it describes, either as a DateTime or as a textual string indicating a time"
"period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals)."
"In the case of a Dataset it will typically indicate the relevant time period in a precise"
'notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012").'
"Other forms of content, e.g. ScholarlyArticle, Book, TVSeries or TVEpisode, may indicate"
"their temporalCoverage in broader terms - textually or via well-known URL. Written"
"works such as books may sometimes have precise temporal coverage too, e.g. a work set"
'in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945".Open-ended'
'date ranges can be written with ".." in place of the end date. For example, "2015-11/.."'
"indicates a range beginning in November 2015 and with no specified final date. This is"
"tentative and might be updated in future when ISO 8601 is officially updated.",
)
dateCreated: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date on which the CreativeWork was created or the item was added to a DataFeed.",
)
discussionUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A link to the page containing the comments of the CreativeWork.",
)
copyrightNotice: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Text of a notice appropriate for describing the copyright aspects of this Creative Work,"
"ideally indicating the owner of the copyright for the Work.",
)
learningResourceType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The predominant type or kind characterizing the learning resource. For example, 'presentation',"
"'handout'.",
)
awards: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Awards won by or for this item.",
)
accessModeSufficient: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A list of single or combined accessModes that are sufficient to understand all the intellectual"
"content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
conditionsOfAccess: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Conditions that affect the availability of, or method(s) of access to, an item. Typically"
"used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]."
"This property is not suitable for use as a general Web access control mechanism. It is"
'expressed only in natural language.For example "Available by appointment from the'
'Reading Room" or "Accessible only from logged-in accounts ".',
)
interactivityType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The predominant mode of learning supported by the learning resource. Acceptable values"
"are 'active', 'expositive', or 'mixed'.",
)
abstract: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An abstract is a short description that summarizes a [[CreativeWork]].",
)
fileFormat: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml))"
"of the content, e.g. application/zip of a SoftwareApplication binary. In cases where"
"a CreativeWork has several media type representations, 'encoding' can be used to indicate"
"each MediaObject alongside particular fileFormat information. Unregistered or niche"
"file formats can be indicated instead via the most appropriate URL, e.g. defining Web"
"page or a Wikipedia entry.",
)
interpretedAsClaim: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Used to indicate a specific claim contained, implied, translated or refined from the"
"content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can"
"be indicated using [[claimInterpreter]].",
)
text: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The textual content of this CreativeWork.",
)
archivedAt: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case"
"of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible,"
"but be archived by archival, journalistic, activist, or law enforcement organizations."
"In such cases, the referenced page may not directly publish the content.",
)
alternativeHeadline: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A secondary title of the CreativeWork.",
)
creditText: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Text that can be used to credit person(s) and/or organization(s) associated with a published"
"Creative Work.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
interactionStatistic: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication."
"The most specific child type of InteractionCounter should be used.",
)
workExample: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Example/instance/realization/derivation of the concept of this creative work. E.g."
"the paperback edition, first edition, or e-book.",
)
about: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The subject matter of the content.",
)
encodings: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork.",
)
funder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports (sponsors) something through some kind of financial"
"contribution.",
)
video: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An embedded video object.",
)
isPartOf: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is"
"part of.",
)
pattern: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'."
"Values are typically expressed as text, although links to controlled value schemes"
"are also supported.",
)
editor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the Person who edited the CreativeWork.",
)
dateModified: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date on which the CreativeWork was most recently modified or when the item's entry"
"was modified within a DataFeed.",
)
translationOfWork: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The work that this work has been translated from. E.g. 物种起源 is a translationOf “On the"
"Origin of Species”.",
)
creativeWorkStatus: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The status of a creative work in terms of its stage in a lifecycle. Example terms include"
"Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for"
"the stages of their publication lifecycle.",
)
isBasedOnUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A resource that was used in the creation of this resource. This term can be repeated for"
"multiple sources. For example, http://example.com/great-multiplication-intro.html.",
)
isFamilyFriendly: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether this content is family friendly.",
)
isAccessibleForFree: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the item, event, or place is accessible for free.",
)
author: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The author of this content or rating. Please note that author is special in that HTML 5"
"provides a special mechanism for indicating authorship via the rel tag. That is equivalent"
"to this and may be used interchangeably.",
)
contentReferenceTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The specific time described by a creative work, for works (e.g. articles, video objects"
"etc.) that emphasise a particular moment within an Event.",
)
correction: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]],"
"textually or in another document.",
)
sdDatePublished: Optional[
Union[List[Union[str, Any, date]], str, Any, date]
] = Field(
default=None,
description="Indicates the date on which the current structured data was generated / published. Typically"
"used alongside [[sdPublisher]]",
)
comment: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Comments, typically from users.",
)
countryOfOrigin: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The country of origin of something, including products as well as creative works such"
"as movie and TV content.In the case of TV and movie, this would be the country of the principle"
"offices of the production company or individual responsible for the movie. For other"
"kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties"
"such as [[contentLocation]] and [[locationCreated]] may be more applicable.In the"
"case of products, the country of origin of the product. The exact interpretation of this"
"may vary by context and product type, and cannot be fully enumerated here.",
)
timeRequired: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Approximate or typical time it takes to work with or through this learning resource for"
"the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.",
)
typicalAgeRange: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The typical expected age range, e.g. '7-9', '11-'.",
)
genre: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Genre of the creative work, broadcast channel or group.",
)
producer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The person or organization who produced the work (e.g. music album, movie, TV/radio"
"series etc.).",
)
schemaVersion: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Indicates (by URL or string) a particular version of a schema used in some CreativeWork."
"This property was created primarily to indicate the use of a specific schema.org release,"
"e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```."
"There may be situations in which other schemas might usefully be referenced this way,"
"e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/```"
"but this has not been carefully explored in the community.",
)
audience: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An intended audience, i.e. a group for whom something was created.",
)
encoding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.",
)
publisherImprint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The publishing division which published the comic.",
)
accessibilityAPI: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Indicates that the resource is compatible with the referenced accessibility API. Values"
"should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).",
)
sdPublisher: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the party responsible for generating and publishing the current structured"
"data markup, typically in cases where the structured data is derived automatically"
"from existing published content but published on a different site. For example, student"
"projects and open data initiatives often re-publish existing content with more explicitly"
"structured metadata. The[[sdPublisher]] property helps make such practices more"
"explicit.",
)
audio: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An embedded audio object.",
)
accessibilityFeature: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Content features of the resource, such as accessible media, alternatives and supported"
"enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).",
)
spatialCoverage: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of"
"the content. It is a subproperty of contentLocation intended primarily for more technical"
"and detailed materials. For example with a Dataset, it indicates areas that the dataset"
"describes: a dataset of New York weather would have spatialCoverage which was the place:"
"the state of New York.",
)
accessMode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The human sensory perceptual system or cognitive faculty through which a person may"
"process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).",
)
editEIDR: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]]"
"representing a specific edit / edition for a work of film or television.For example,"
'the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J"'
'has several edits, e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3".Since'
"schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their"
"multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description),"
"or alongside [[editEIDR]] for a more edit-specific description.",
)
usageInfo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]."
"This property is applicable both to works that are freely available and to those that"
"require payment or other transactions. It can reference additional information, e.g."
"community expectations on preferred linking and citation conventions, as well as purchasing"
"details. For something that can be commercially licensed, usageInfo can provide detailed,"
"resource-specific information about licensing options.This property can be used"
"alongside the license property which indicates license(s) applicable to some piece"
"of content. The usageInfo property can provide information about other licensing options,"
"e.g. acquiring commercial usage rights for an image that is also available under non-commercial"
"creative commons licenses.",
)
position: Union[List[Union[str, int, Any]], str, int, Any] = Field(
default=None,
description="The position of an item in a series or sequence of items.",
)
encodingFormat: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)"
"and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)),"
"e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In"
"cases where a [[CreativeWork]] has several media type representations, [[encoding]]"
"can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]]"
"information.Unregistered or niche encoding and file formats can be indicated instead"
"via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.",
)
copyrightYear: Optional[
Union[
List[Union[str, Any, StrictInt, StrictFloat]],
str,
Any,
StrictInt,
StrictFloat,
]
] = Field(
default=None,
description="The year during which the claimed copyright for the CreativeWork was first asserted.",
)
mainEntity: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the primary entity described in some page or other CreativeWork.",
)
creator: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The creator/author of this CreativeWork. This is the same as the Author property for"
"CreativeWork.",
)
teaches: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The item being described is intended to help a person learn the competency or learning"
"outcome defined by the referenced term.",
)
temporal: Union[List[Union[datetime, str, Any]], datetime, str, Any] = Field(
default=None,
description='The "temporal" property can be used in cases where more specific properties(e.g.'
"[[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]])"
"are not known to be appropriate.",
)
size: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A standardized size of a product or creative work, specified either through a simple"
"textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode,"
"or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]],"
"[[height]], [[depth]] and [[weight]] properties may be more applicable.",
)
translator: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Organization or person who adapts a creative work to different languages, regional"
"differences and technical requirements of a target market, or that translates during"
"some event.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
accountablePerson: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the Person that is legally accountable for the CreativeWork.",
)
accessibilityHazard: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A characteristic of the described resource that is physiologically dangerous to some"
"users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).",
)
contentRating: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Official rating of a piece of content—for example, 'MPAA PG-13'.",
)
recordedAt: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The Event where the CreativeWork was recorded. The CreativeWork may capture all or part"
"of the event.",
)
publication: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A publication event associated with the item.",
)
sdLicense: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A license document that applies to this structured data, typically indicated by URL.",
)
headline: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Headline of the article.",
)
materialExtent: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The quantity of the materials being described or an expression of the physical space"
"they occupy.",
)
inLanguage: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The language of the content or performance or used in an action. Please use one of the language"
"codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also"
"[[availableLanguage]].",
)
material: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="A material that something is made from, e.g. leather, wool, cotton, paper.",
)
datePublished: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="Date of first broadcast/publication.",
)
offers: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An offer to provide this item—for example, an offer to sell a product, rent the"
"DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]"
"to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can"
"also be used to describe a [[Demand]]. While this property is listed as expected on a number"
"of common types, it can be used in others. In that case, using a second type, such as Product"
"or a subtype of Product, can clarify the nature of the offer.",
)
hasPart: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some"
"sense).",
)
sourceOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The Organization on whose behalf the creator was working.",
)
sponsor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports a thing through a pledge, promise, or financial"
"contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.",
)
character: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Fictional person connected with a creative work.",
)
xpath: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An XPath, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the latter"
'case, multiple matches within a page can constitute a single conceptual "Web page element".',
)
cssSelector: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A CSS selector, e.g. of a [[SpeakableSpecification]] or [[WebPageElement]]. In the"
'latter case, multiple matches within a page can constitute a single conceptual "Web'
'page element".',
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/Table.py
| 0.939533 | 0.346901 |
Table.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class LocationFeatureSpecification(BaseModel):
"""Specifies a location feature by providing a structured value representing a feature of an accommodation as a property-value pair of varying degrees of formality.
References:
https://schema.org/LocationFeatureSpecification
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
value: (Union[List[Union[str, StrictBool, Any, StrictInt, StrictFloat]], str, StrictBool, Any, StrictInt, StrictFloat]): The value of the quantitative value or property value node.* For [[QuantitativeValue]] and [[MonetaryAmount]], the recommended type for values is 'Number'.* For [[PropertyValue]], it can be 'Text', 'Number', 'Boolean', or 'StructuredValue'.* Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially similar Unicode symbols.* Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid using these symbols as a readability separator.
valueReference: (Union[List[Union[str, Any]], str, Any]): A secondary value that provides additional information on the original value, e.g. a reference temperature or a type of measurement.
measurementTechnique: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): A technique or technology used in a [[Dataset]] (or [[DataDownload]], [[DataCatalog]]),corresponding to the method used for measuring the corresponding variable(s) (described using [[variableMeasured]]). This is oriented towards scientific and scholarly dataset publication but may have broader applicability; it is not intended as a full representation of measurement, but rather as a high level summary for dataset discovery.For example, if [[variableMeasured]] is: molecule concentration, [[measurementTechnique]] could be: "mass spectrometry" or "nmr spectroscopy" or "colorimetry" or "immunofluorescence".If the [[variableMeasured]] is "depression rating", the [[measurementTechnique]] could be "Zung Scale" or "HAM-D" or "Beck Depression Inventory".If there are several [[variableMeasured]] properties recorded for some given data object, use a [[PropertyValue]] for each [[variableMeasured]] and attach the corresponding [[measurementTechnique]].
unitCode: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL. Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.
maxValue: (Optional[Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]]): The upper value of some characteristic or property.
unitText: (Union[List[Union[str, Any]], str, Any]): A string or text indicating the unit of measurement. Useful if you cannot provide a standard unit code for<a href='unitCode'>unitCode</a>.
propertyID: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): A commonly used identifier for the characteristic represented by the property, e.g. a manufacturer or a standard code for a property. propertyID can be(1) a prefixed string, mainly meant to be used with standards for product properties; (2) a site-specific, non-prefixed string (e.g. the primary key of the property or the vendor-specific ID of the property), or (3)a URL indicating the type of the property, either pointing to an external vocabulary, or a Web resource that describes the property (e.g. a glossary entry).Standards bodies should promote a standard prefix for the identifiers of properties from their standards.
minValue: (Optional[Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]]): The lower value of some characteristic or property.
validThrough: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date after when the item is not valid. For example the end of an offer, salary period, or a period of opening hours.
hoursAvailable: (Optional[Union[List[Union[str, Any]], str, Any]]): The hours during which this service or contact is available.
validFrom: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date when the item becomes valid.
"""
type_: str = Field(
default="LocationFeatureSpecification", alias="@type", const=True
)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
value: Union[
List[Union[str, StrictBool, Any, StrictInt, StrictFloat]],
str,
StrictBool,
Any,
StrictInt,
StrictFloat,
] = Field(
default=None,
description="The value of the quantitative value or property value node.* For [[QuantitativeValue]]"
"and [[MonetaryAmount]], the recommended type for values is 'Number'.* For [[PropertyValue]],"
"it can be 'Text', 'Number', 'Boolean', or 'StructuredValue'.* Use values from 0123456789"
"(Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially"
"similar Unicode symbols.* Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to"
"indicate a decimal point. Avoid using these symbols as a readability separator.",
)
valueReference: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A secondary value that provides additional information on the original value, e.g."
"a reference temperature or a type of measurement.",
)
measurementTechnique: Union[
List[Union[str, AnyUrl, Any]], str, AnyUrl, Any
] = Field(
default=None,
description="A technique or technology used in a [[Dataset]] (or [[DataDownload]], [[DataCatalog]]),corresponding"
"to the method used for measuring the corresponding variable(s) (described using [[variableMeasured]])."
"This is oriented towards scientific and scholarly dataset publication but may have"
"broader applicability; it is not intended as a full representation of measurement,"
"but rather as a high level summary for dataset discovery.For example, if [[variableMeasured]]"
'is: molecule concentration, [[measurementTechnique]] could be: "mass spectrometry"'
'or "nmr spectroscopy" or "colorimetry" or "immunofluorescence".If the [[variableMeasured]]'
'is "depression rating", the [[measurementTechnique]] could be "Zung Scale" or'
'"HAM-D" or "Beck Depression Inventory".If there are several [[variableMeasured]]'
"properties recorded for some given data object, use a [[PropertyValue]] for each [[variableMeasured]]"
"and attach the corresponding [[measurementTechnique]].",
)
unitCode: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL."
"Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.",
)
maxValue: Optional[
Union[
List[Union[str, Any, StrictInt, StrictFloat]],
str,
Any,
StrictInt,
StrictFloat,
]
] = Field(
default=None,
description="The upper value of some characteristic or property.",
)
unitText: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A string or text indicating the unit of measurement. Useful if you cannot provide a standard"
"unit code for<a href='unitCode'>unitCode</a>.",
)
propertyID: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="A commonly used identifier for the characteristic represented by the property, e.g."
"a manufacturer or a standard code for a property. propertyID can be(1) a prefixed string,"
"mainly meant to be used with standards for product properties; (2) a site-specific,"
"non-prefixed string (e.g. the primary key of the property or the vendor-specific ID"
"of the property), or (3)a URL indicating the type of the property, either pointing to"
"an external vocabulary, or a Web resource that describes the property (e.g. a glossary"
"entry).Standards bodies should promote a standard prefix for the identifiers of properties"
"from their standards.",
)
minValue: Optional[
Union[
List[Union[str, Any, StrictInt, StrictFloat]],
str,
Any,
StrictInt,
StrictFloat,
]
] = Field(
default=None,
description="The lower value of some characteristic or property.",
)
validThrough: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date after when the item is not valid. For example the end of an offer, salary period,"
"or a period of opening hours.",
)
hoursAvailable: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The hours during which this service or contact is available.",
)
validFrom: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date when the item becomes valid.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/LocationFeatureSpecification.py
| 0.952717 | 0.446253 |
LocationFeatureSpecification.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class EndorseAction(BaseModel):
"""An agent approves/certifies/likes/supports/sanctions an object.
References:
https://schema.org/EndorseAction
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
endTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. E.g. John wrote a book from January to *December*. For media, including audio and video, it's the time offset of the end of a clip within a larger file.Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.
provider: (Optional[Union[List[Union[str, Any]], str, Any]]): The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller.
startTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. E.g. John wrote a book from *January* to December. For media, including audio and video, it's the time offset of the start of a clip within a larger file.Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.
result: (Optional[Union[List[Union[str, Any]], str, Any]]): The result produced in the action. E.g. John wrote *a book*.
actionStatus: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the current disposition of the Action.
agent: (Optional[Union[List[Union[str, Any]], str, Any]]): The direct performer or driver of the action (animate or inanimate). E.g. *John* wrote a book.
instrument: (Optional[Union[List[Union[str, Any]], str, Any]]): The object that helped the agent perform the action. E.g. John wrote a book with *a pen*.
object: (Optional[Union[List[Union[str, Any]], str, Any]]): The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn't). E.g. John read *a book*.
error: (Optional[Union[List[Union[str, Any]], str, Any]]): For failed actions, more information on the cause of the failure.
target: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a target EntryPoint, or url, for an Action.
location: (Union[List[Union[str, Any]], str, Any]): The location of, for example, where an event is happening, where an organization is located, or where an action takes place.
participant: (Optional[Union[List[Union[str, Any]], str, Any]]): Other co-agents that participated in the action indirectly. E.g. John wrote a book with *Steve*.
endorsee: (Optional[Union[List[Union[str, Any]], str, Any]]): A sub property of participant. The person/organization being supported.
"""
type_: str = Field(default="EndorseAction", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
endTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation),"
"the time that it is expected to end. For actions that span a period of time, when the action"
"was performed. E.g. John wrote a book from January to *December*. For media, including"
"audio and video, it's the time offset of the end of a clip within a larger file.Note that"
"Event uses startDate/endDate instead of startTime/endTime, even when describing"
"dates with times. This situation may be clarified in future revisions.",
)
provider: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The service provider, service operator, or service performer; the goods producer."
"Another party (a seller) may offer those services or goods on behalf of the provider."
"A provider may also serve as the seller.",
)
startTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation),"
"the time that it is expected to start. For actions that span a period of time, when the action"
"was performed. E.g. John wrote a book from *January* to December. For media, including"
"audio and video, it's the time offset of the start of a clip within a larger file.Note that"
"Event uses startDate/endDate instead of startTime/endTime, even when describing"
"dates with times. This situation may be clarified in future revisions.",
)
result: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The result produced in the action. E.g. John wrote *a book*.",
)
actionStatus: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the current disposition of the Action.",
)
agent: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The direct performer or driver of the action (animate or inanimate). E.g. *John* wrote"
"a book.",
)
instrument: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The object that helped the agent perform the action. E.g. John wrote a book with *a pen*.",
)
object: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The object upon which the action is carried out, whose state is kept intact or changed."
"Also known as the semantic roles patient, affected or undergoer (which change their"
"state) or theme (which doesn't). E.g. John read *a book*.",
)
error: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="For failed actions, more information on the cause of the failure.",
)
target: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="Indicates a target EntryPoint, or url, for an Action.",
)
location: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The location of, for example, where an event is happening, where an organization is located,"
"or where an action takes place.",
)
participant: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Other co-agents that participated in the action indirectly. E.g. John wrote a book with"
"*Steve*.",
)
endorsee: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A sub property of participant. The person/organization being supported.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/EndorseAction.py
| 0.937361 | 0.34494 |
EndorseAction.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class EmailMessage(BaseModel):
"""An email message.
References:
https://schema.org/EmailMessage
Note:
Model Depth 4
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
workTranslation: (Optional[Union[List[Union[str, Any]], str, Any]]): A work that is a translation of the content of this work. E.g. 西遊記 has an English workTranslation “Journey to the West”, a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.
educationalLevel: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The level in terms of progression through an educational or training context. Examples of educational levels include 'beginner', 'intermediate' or 'advanced', and formal sets of level indicators.
associatedMedia: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork. This property is a synonym for encoding.
exampleOfWork: (Optional[Union[List[Union[str, Any]], str, Any]]): A creative work that this work is an example/instance/realization/derivation of.
releasedEvent: (Optional[Union[List[Union[str, Any]], str, Any]]): The place and time the release was issued, expressed as a PublicationEvent.
version: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The version of the CreativeWork embodied by a specified resource.
locationCreated: (Optional[Union[List[Union[str, Any]], str, Any]]): The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.
acquireLicensePage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.
thumbnailUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A thumbnail image relevant to the Thing.
provider: (Optional[Union[List[Union[str, Any]], str, Any]]): The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller.
expires: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.
contentLocation: (Optional[Union[List[Union[str, Any]], str, Any]]): The location depicted or described in the content. For example, the location in a photograph or painting.
educationalUse: (Union[List[Union[str, Any]], str, Any]): The purpose of a work in the context of education; for example, 'assignment', 'group work'.
copyrightHolder: (Optional[Union[List[Union[str, Any]], str, Any]]): The party holding the legal copyright to the CreativeWork.
accessibilityControl: (Union[List[Union[str, Any]], str, Any]): Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).
maintainer: (Optional[Union[List[Union[str, Any]], str, Any]]): A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.
educationalAlignment: (Optional[Union[List[Union[str, Any]], str, Any]]): An alignment to an established educational framework.This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.
spatial: (Optional[Union[List[Union[str, Any]], str, Any]]): The "spatial" property can be used in cases when more specific properties(e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.
publisher: (Optional[Union[List[Union[str, Any]], str, Any]]): The publisher of the creative work.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
assesses: (Union[List[Union[str, Any]], str, Any]): The item being described is intended to assess the competency or learning outcome defined by the referenced term.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
isBasedOn: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A resource from which this work is derived or from which it is a modification or adaption.
mentions: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.
publishingPrinciples: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]].While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.
contributor: (Optional[Union[List[Union[str, Any]], str, Any]]): A secondary contributor to the CreativeWork or Event.
license: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A license document that applies to this content, typically indicated by URL.
citation: (Union[List[Union[str, Any]], str, Any]): A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.
accessibilitySummary: (Union[List[Union[str, Any]], str, Any]): A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."
award: (Union[List[Union[str, Any]], str, Any]): An award won by or for this item.
commentCount: (Optional[Union[List[Union[str, int, Any]], str, int, Any]]): The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.
temporalCoverage: (Union[List[Union[datetime, str, Any, AnyUrl]], datetime, str, Any, AnyUrl]): The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content, e.g. ScholarlyArticle, Book, TVSeries or TVEpisode, may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945".Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.
dateCreated: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date on which the CreativeWork was created or the item was added to a DataFeed.
discussionUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A link to the page containing the comments of the CreativeWork.
copyrightNotice: (Union[List[Union[str, Any]], str, Any]): Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.
learningResourceType: (Union[List[Union[str, Any]], str, Any]): The predominant type or kind characterizing the learning resource. For example, 'presentation', 'handout'.
awards: (Union[List[Union[str, Any]], str, Any]): Awards won by or for this item.
accessModeSufficient: (Optional[Union[List[Union[str, Any]], str, Any]]): A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
conditionsOfAccess: (Union[List[Union[str, Any]], str, Any]): Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language.For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".
interactivityType: (Union[List[Union[str, Any]], str, Any]): The predominant mode of learning supported by the learning resource. Acceptable values are 'active', 'expositive', or 'mixed'.
abstract: (Union[List[Union[str, Any]], str, Any]): An abstract is a short description that summarizes a [[CreativeWork]].
fileFormat: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content, e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, 'encoding' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.
interpretedAsClaim: (Optional[Union[List[Union[str, Any]], str, Any]]): Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].
text: (Union[List[Union[str, Any]], str, Any]): The textual content of this CreativeWork.
archivedAt: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.
alternativeHeadline: (Union[List[Union[str, Any]], str, Any]): A secondary title of the CreativeWork.
creditText: (Union[List[Union[str, Any]], str, Any]): Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
interactionStatistic: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.
workExample: (Optional[Union[List[Union[str, Any]], str, Any]]): Example/instance/realization/derivation of the concept of this creative work. E.g. the paperback edition, first edition, or e-book.
about: (Optional[Union[List[Union[str, Any]], str, Any]]): The subject matter of the content.
encodings: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork.
funder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports (sponsors) something through some kind of financial contribution.
video: (Optional[Union[List[Union[str, Any]], str, Any]]): An embedded video object.
isPartOf: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.
pattern: (Union[List[Union[str, Any]], str, Any]): A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'. Values are typically expressed as text, although links to controlled value schemes are also supported.
editor: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the Person who edited the CreativeWork.
dateModified: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date on which the CreativeWork was most recently modified or when the item's entry was modified within a DataFeed.
translationOfWork: (Optional[Union[List[Union[str, Any]], str, Any]]): The work that this work has been translated from. E.g. 物种起源 is a translationOf “On the Origin of Species”.
creativeWorkStatus: (Union[List[Union[str, Any]], str, Any]): The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.
isBasedOnUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.
isFamilyFriendly: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether this content is family friendly.
isAccessibleForFree: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the item, event, or place is accessible for free.
author: (Optional[Union[List[Union[str, Any]], str, Any]]): The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.
contentReferenceTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.
correction: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.
sdDatePublished: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]
comment: (Optional[Union[List[Union[str, Any]], str, Any]]): Comments, typically from users.
countryOfOrigin: (Optional[Union[List[Union[str, Any]], str, Any]]): The country of origin of something, including products as well as creative works such as movie and TV content.In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable.In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.
timeRequired: (Optional[Union[List[Union[str, Any]], str, Any]]): Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.
typicalAgeRange: (Union[List[Union[str, Any]], str, Any]): The typical expected age range, e.g. '7-9', '11-'.
genre: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Genre of the creative work, broadcast channel or group.
producer: (Optional[Union[List[Union[str, Any]], str, Any]]): The person or organization who produced the work (e.g. music album, movie, TV/radio series etc.).
schemaVersion: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.
audience: (Optional[Union[List[Union[str, Any]], str, Any]]): An intended audience, i.e. a group for whom something was created.
encoding: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.
publisherImprint: (Optional[Union[List[Union[str, Any]], str, Any]]): The publishing division which published the comic.
accessibilityAPI: (Union[List[Union[str, Any]], str, Any]): Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).
sdPublisher: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The[[sdPublisher]] property helps make such practices more explicit.
audio: (Optional[Union[List[Union[str, Any]], str, Any]]): An embedded audio object.
accessibilityFeature: (Union[List[Union[str, Any]], str, Any]): Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).
spatialCoverage: (Optional[Union[List[Union[str, Any]], str, Any]]): The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.
accessMode: (Union[List[Union[str, Any]], str, Any]): The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).
editEIDR: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television.For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J" has several edits, e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3".Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description.
usageInfo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information, e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options.This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.
position: (Union[List[Union[str, int, Any]], str, int, Any]): The position of an item in a series or sequence of items.
encodingFormat: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)), e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information.Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.
copyrightYear: (Optional[Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]]): The year during which the claimed copyright for the CreativeWork was first asserted.
mainEntity: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the primary entity described in some page or other CreativeWork.
creator: (Optional[Union[List[Union[str, Any]], str, Any]]): The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.
teaches: (Union[List[Union[str, Any]], str, Any]): The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.
temporal: (Union[List[Union[datetime, str, Any]], datetime, str, Any]): The "temporal" property can be used in cases where more specific properties(e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.
size: (Union[List[Union[str, Any]], str, Any]): A standardized size of a product or creative work, specified either through a simple textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable.
translator: (Optional[Union[List[Union[str, Any]], str, Any]]): Organization or person who adapts a creative work to different languages, regional differences and technical requirements of a target market, or that translates during some event.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
accountablePerson: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the Person that is legally accountable for the CreativeWork.
accessibilityHazard: (Union[List[Union[str, Any]], str, Any]): A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).
contentRating: (Union[List[Union[str, Any]], str, Any]): Official rating of a piece of content—for example, 'MPAA PG-13'.
recordedAt: (Optional[Union[List[Union[str, Any]], str, Any]]): The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.
publication: (Optional[Union[List[Union[str, Any]], str, Any]]): A publication event associated with the item.
sdLicense: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A license document that applies to this structured data, typically indicated by URL.
headline: (Union[List[Union[str, Any]], str, Any]): Headline of the article.
materialExtent: (Union[List[Union[str, Any]], str, Any]): The quantity of the materials being described or an expression of the physical space they occupy.
inLanguage: (Union[List[Union[str, Any]], str, Any]): The language of the content or performance or used in an action. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[availableLanguage]].
material: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): A material that something is made from, e.g. leather, wool, cotton, paper.
datePublished: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): Date of first broadcast/publication.
offers: (Optional[Union[List[Union[str, Any]], str, Any]]): An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]] to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can also be used to describe a [[Demand]]. While this property is listed as expected on a number of common types, it can be used in others. In that case, using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.
hasPart: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).
sourceOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): The Organization on whose behalf the creator was working.
sponsor: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.
character: (Optional[Union[List[Union[str, Any]], str, Any]]): Fictional person connected with a creative work.
dateReceived: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The date/time the message was received if a single recipient exists.
recipient: (Optional[Union[List[Union[str, Any]], str, Any]]): A sub property of participant. The participant who is at the receiving end of the action.
messageAttachment: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork attached to the message.
ccRecipient: (Optional[Union[List[Union[str, Any]], str, Any]]): A sub property of recipient. The recipient copied on a message.
bccRecipient: (Optional[Union[List[Union[str, Any]], str, Any]]): A sub property of recipient. The recipient blind copied on a message.
dateRead: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date/time at which the message has been read by the recipient if a single recipient exists.
dateSent: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The date/time at which the message was sent.
sender: (Optional[Union[List[Union[str, Any]], str, Any]]): A sub property of participant. The participant who is at the sending end of the action.
toRecipient: (Optional[Union[List[Union[str, Any]], str, Any]]): A sub property of recipient. The recipient who was directly sent the message.
"""
type_: str = Field(default="EmailMessage", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
workTranslation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A work that is a translation of the content of this work. E.g. 西遊記 has an English workTranslation"
"“Journey to the West”, a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese"
"translation Tây du ký bình khảo.",
)
educationalLevel: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The level in terms of progression through an educational or training context. Examples"
"of educational levels include 'beginner', 'intermediate' or 'advanced', and formal"
"sets of level indicators.",
)
associatedMedia: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork. This property is a synonym for encoding.",
)
exampleOfWork: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A creative work that this work is an example/instance/realization/derivation of.",
)
releasedEvent: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The place and time the release was issued, expressed as a PublicationEvent.",
)
version: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The version of the CreativeWork embodied by a specified resource.",
)
locationCreated: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The location where the CreativeWork was created, which may not be the same as the location"
"depicted in the CreativeWork.",
)
acquireLicensePage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page documenting how licenses can be purchased or otherwise acquired, for"
"the current item.",
)
thumbnailUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A thumbnail image relevant to the Thing.",
)
provider: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The service provider, service operator, or service performer; the goods producer."
"Another party (a seller) may offer those services or goods on behalf of the provider."
"A provider may also serve as the seller.",
)
expires: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="Date the content expires and is no longer useful or available. For example a [[VideoObject]]"
"or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]]"
"fact check whose publisher wants to indicate that it may no longer be relevant (or helpful"
"to highlight) after some date.",
)
contentLocation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The location depicted or described in the content. For example, the location in a photograph"
"or painting.",
)
educationalUse: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The purpose of a work in the context of education; for example, 'assignment', 'group"
"work'.",
)
copyrightHolder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The party holding the legal copyright to the CreativeWork.",
)
accessibilityControl: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Identifies input methods that are sufficient to fully control the described resource."
"Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).",
)
maintainer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other"
"[[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions"
"to, and/or publication of, some (typically complex) artifact. It is common for distributions"
'of software and data to be based on "upstream" sources. When [[maintainer]] is applied'
"to a specific version of something e.g. a particular version or packaging of a [[Dataset]],"
"it is always possible that the upstream source has a different maintainer. The [[isBasedOn]]"
"property can be used to indicate such relationships between datasets to make the different"
"maintenance roles clear. Similarly in the case of software, a package may have dedicated"
"maintainers working on integration into software distributions such as Ubuntu, as"
"well as upstream maintainers of the underlying work.",
)
educationalAlignment: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An alignment to an established educational framework.This property should not be used"
"where the nature of the alignment can be described using a simple property, for example"
"to express that a resource [[teaches]] or [[assesses]] a competency.",
)
spatial: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description='The "spatial" property can be used in cases when more specific properties(e.g. [[locationCreated]],'
"[[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.",
)
publisher: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The publisher of the creative work.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
assesses: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The item being described is intended to assess the competency or learning outcome defined"
"by the referenced term.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
isBasedOn: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A resource from which this work is derived or from which it is a modification or adaption.",
)
mentions: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates that the CreativeWork contains a reference to, but is not necessarily about"
"a concept.",
)
publishingPrinciples: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing"
"the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]]"
"writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity"
"policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles"
"are those of the party primarily responsible for the creation of the [[CreativeWork]].While"
"such policies are most typically expressed in natural language, sometimes related"
"information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.",
)
contributor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A secondary contributor to the CreativeWork or Event.",
)
license: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A license document that applies to this content, typically indicated by URL.",
)
citation: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A citation or reference to another creative work, such as another publication, web page,"
"scholarly article, etc.",
)
accessibilitySummary: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A human-readable summary of specific accessibility features or deficiencies, consistent"
'with the other accessibility metadata but expressing subtleties such as "short descriptions'
'are present but long descriptions will be needed for non-visual users" or "short descriptions'
'are present and no long descriptions are needed."',
)
award: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An award won by or for this item.",
)
commentCount: Optional[Union[List[Union[str, int, Any]], str, int, Any]] = Field(
default=None,
description="The number of comments this CreativeWork (e.g. Article, Question or Answer) has received."
"This is most applicable to works published in Web sites with commenting system; additional"
"comments may exist elsewhere.",
)
temporalCoverage: Union[
List[Union[datetime, str, Any, AnyUrl]], datetime, str, Any, AnyUrl
] = Field(
default=None,
description="The temporalCoverage of a CreativeWork indicates the period that the content applies"
"to, i.e. that it describes, either as a DateTime or as a textual string indicating a time"
"period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals)."
"In the case of a Dataset it will typically indicate the relevant time period in a precise"
'notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012").'
"Other forms of content, e.g. ScholarlyArticle, Book, TVSeries or TVEpisode, may indicate"
"their temporalCoverage in broader terms - textually or via well-known URL. Written"
"works such as books may sometimes have precise temporal coverage too, e.g. a work set"
'in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945".Open-ended'
'date ranges can be written with ".." in place of the end date. For example, "2015-11/.."'
"indicates a range beginning in November 2015 and with no specified final date. This is"
"tentative and might be updated in future when ISO 8601 is officially updated.",
)
dateCreated: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date on which the CreativeWork was created or the item was added to a DataFeed.",
)
discussionUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A link to the page containing the comments of the CreativeWork.",
)
copyrightNotice: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Text of a notice appropriate for describing the copyright aspects of this Creative Work,"
"ideally indicating the owner of the copyright for the Work.",
)
learningResourceType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The predominant type or kind characterizing the learning resource. For example, 'presentation',"
"'handout'.",
)
awards: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Awards won by or for this item.",
)
accessModeSufficient: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A list of single or combined accessModes that are sufficient to understand all the intellectual"
"content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
conditionsOfAccess: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Conditions that affect the availability of, or method(s) of access to, an item. Typically"
"used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]."
"This property is not suitable for use as a general Web access control mechanism. It is"
'expressed only in natural language.For example "Available by appointment from the'
'Reading Room" or "Accessible only from logged-in accounts ".',
)
interactivityType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The predominant mode of learning supported by the learning resource. Acceptable values"
"are 'active', 'expositive', or 'mixed'.",
)
abstract: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An abstract is a short description that summarizes a [[CreativeWork]].",
)
fileFormat: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml))"
"of the content, e.g. application/zip of a SoftwareApplication binary. In cases where"
"a CreativeWork has several media type representations, 'encoding' can be used to indicate"
"each MediaObject alongside particular fileFormat information. Unregistered or niche"
"file formats can be indicated instead via the most appropriate URL, e.g. defining Web"
"page or a Wikipedia entry.",
)
interpretedAsClaim: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Used to indicate a specific claim contained, implied, translated or refined from the"
"content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can"
"be indicated using [[claimInterpreter]].",
)
text: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The textual content of this CreativeWork.",
)
archivedAt: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case"
"of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible,"
"but be archived by archival, journalistic, activist, or law enforcement organizations."
"In such cases, the referenced page may not directly publish the content.",
)
alternativeHeadline: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A secondary title of the CreativeWork.",
)
creditText: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Text that can be used to credit person(s) and/or organization(s) associated with a published"
"Creative Work.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
interactionStatistic: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication."
"The most specific child type of InteractionCounter should be used.",
)
workExample: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Example/instance/realization/derivation of the concept of this creative work. E.g."
"the paperback edition, first edition, or e-book.",
)
about: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The subject matter of the content.",
)
encodings: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork.",
)
funder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports (sponsors) something through some kind of financial"
"contribution.",
)
video: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An embedded video object.",
)
isPartOf: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is"
"part of.",
)
pattern: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'."
"Values are typically expressed as text, although links to controlled value schemes"
"are also supported.",
)
editor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the Person who edited the CreativeWork.",
)
dateModified: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date on which the CreativeWork was most recently modified or when the item's entry"
"was modified within a DataFeed.",
)
translationOfWork: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The work that this work has been translated from. E.g. 物种起源 is a translationOf “On the"
"Origin of Species”.",
)
creativeWorkStatus: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The status of a creative work in terms of its stage in a lifecycle. Example terms include"
"Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for"
"the stages of their publication lifecycle.",
)
isBasedOnUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A resource that was used in the creation of this resource. This term can be repeated for"
"multiple sources. For example, http://example.com/great-multiplication-intro.html.",
)
isFamilyFriendly: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether this content is family friendly.",
)
isAccessibleForFree: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the item, event, or place is accessible for free.",
)
author: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The author of this content or rating. Please note that author is special in that HTML 5"
"provides a special mechanism for indicating authorship via the rel tag. That is equivalent"
"to this and may be used interchangeably.",
)
contentReferenceTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The specific time described by a creative work, for works (e.g. articles, video objects"
"etc.) that emphasise a particular moment within an Event.",
)
correction: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]],"
"textually or in another document.",
)
sdDatePublished: Optional[
Union[List[Union[str, Any, date]], str, Any, date]
] = Field(
default=None,
description="Indicates the date on which the current structured data was generated / published. Typically"
"used alongside [[sdPublisher]]",
)
comment: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Comments, typically from users.",
)
countryOfOrigin: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The country of origin of something, including products as well as creative works such"
"as movie and TV content.In the case of TV and movie, this would be the country of the principle"
"offices of the production company or individual responsible for the movie. For other"
"kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties"
"such as [[contentLocation]] and [[locationCreated]] may be more applicable.In the"
"case of products, the country of origin of the product. The exact interpretation of this"
"may vary by context and product type, and cannot be fully enumerated here.",
)
timeRequired: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Approximate or typical time it takes to work with or through this learning resource for"
"the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.",
)
typicalAgeRange: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The typical expected age range, e.g. '7-9', '11-'.",
)
genre: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Genre of the creative work, broadcast channel or group.",
)
producer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The person or organization who produced the work (e.g. music album, movie, TV/radio"
"series etc.).",
)
schemaVersion: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Indicates (by URL or string) a particular version of a schema used in some CreativeWork."
"This property was created primarily to indicate the use of a specific schema.org release,"
"e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```."
"There may be situations in which other schemas might usefully be referenced this way,"
"e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/```"
"but this has not been carefully explored in the community.",
)
audience: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An intended audience, i.e. a group for whom something was created.",
)
encoding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.",
)
publisherImprint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The publishing division which published the comic.",
)
accessibilityAPI: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Indicates that the resource is compatible with the referenced accessibility API. Values"
"should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).",
)
sdPublisher: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the party responsible for generating and publishing the current structured"
"data markup, typically in cases where the structured data is derived automatically"
"from existing published content but published on a different site. For example, student"
"projects and open data initiatives often re-publish existing content with more explicitly"
"structured metadata. The[[sdPublisher]] property helps make such practices more"
"explicit.",
)
audio: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An embedded audio object.",
)
accessibilityFeature: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Content features of the resource, such as accessible media, alternatives and supported"
"enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).",
)
spatialCoverage: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of"
"the content. It is a subproperty of contentLocation intended primarily for more technical"
"and detailed materials. For example with a Dataset, it indicates areas that the dataset"
"describes: a dataset of New York weather would have spatialCoverage which was the place:"
"the state of New York.",
)
accessMode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The human sensory perceptual system or cognitive faculty through which a person may"
"process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).",
)
editEIDR: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]]"
"representing a specific edit / edition for a work of film or television.For example,"
'the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J"'
'has several edits, e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3".Since'
"schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their"
"multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description),"
"or alongside [[editEIDR]] for a more edit-specific description.",
)
usageInfo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]."
"This property is applicable both to works that are freely available and to those that"
"require payment or other transactions. It can reference additional information, e.g."
"community expectations on preferred linking and citation conventions, as well as purchasing"
"details. For something that can be commercially licensed, usageInfo can provide detailed,"
"resource-specific information about licensing options.This property can be used"
"alongside the license property which indicates license(s) applicable to some piece"
"of content. The usageInfo property can provide information about other licensing options,"
"e.g. acquiring commercial usage rights for an image that is also available under non-commercial"
"creative commons licenses.",
)
position: Union[List[Union[str, int, Any]], str, int, Any] = Field(
default=None,
description="The position of an item in a series or sequence of items.",
)
encodingFormat: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)"
"and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)),"
"e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In"
"cases where a [[CreativeWork]] has several media type representations, [[encoding]]"
"can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]]"
"information.Unregistered or niche encoding and file formats can be indicated instead"
"via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.",
)
copyrightYear: Optional[
Union[
List[Union[str, Any, StrictInt, StrictFloat]],
str,
Any,
StrictInt,
StrictFloat,
]
] = Field(
default=None,
description="The year during which the claimed copyright for the CreativeWork was first asserted.",
)
mainEntity: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the primary entity described in some page or other CreativeWork.",
)
creator: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The creator/author of this CreativeWork. This is the same as the Author property for"
"CreativeWork.",
)
teaches: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The item being described is intended to help a person learn the competency or learning"
"outcome defined by the referenced term.",
)
temporal: Union[List[Union[datetime, str, Any]], datetime, str, Any] = Field(
default=None,
description='The "temporal" property can be used in cases where more specific properties(e.g.'
"[[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]])"
"are not known to be appropriate.",
)
size: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A standardized size of a product or creative work, specified either through a simple"
"textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode,"
"or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]],"
"[[height]], [[depth]] and [[weight]] properties may be more applicable.",
)
translator: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Organization or person who adapts a creative work to different languages, regional"
"differences and technical requirements of a target market, or that translates during"
"some event.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
accountablePerson: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the Person that is legally accountable for the CreativeWork.",
)
accessibilityHazard: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A characteristic of the described resource that is physiologically dangerous to some"
"users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).",
)
contentRating: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Official rating of a piece of content—for example, 'MPAA PG-13'.",
)
recordedAt: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The Event where the CreativeWork was recorded. The CreativeWork may capture all or part"
"of the event.",
)
publication: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A publication event associated with the item.",
)
sdLicense: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A license document that applies to this structured data, typically indicated by URL.",
)
headline: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Headline of the article.",
)
materialExtent: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The quantity of the materials being described or an expression of the physical space"
"they occupy.",
)
inLanguage: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The language of the content or performance or used in an action. Please use one of the language"
"codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also"
"[[availableLanguage]].",
)
material: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="A material that something is made from, e.g. leather, wool, cotton, paper.",
)
datePublished: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="Date of first broadcast/publication.",
)
offers: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An offer to provide this item—for example, an offer to sell a product, rent the"
"DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]"
"to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can"
"also be used to describe a [[Demand]]. While this property is listed as expected on a number"
"of common types, it can be used in others. In that case, using a second type, such as Product"
"or a subtype of Product, can clarify the nature of the offer.",
)
hasPart: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some"
"sense).",
)
sourceOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The Organization on whose behalf the creator was working.",
)
sponsor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports a thing through a pledge, promise, or financial"
"contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.",
)
character: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Fictional person connected with a creative work.",
)
dateReceived: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The date/time the message was received if a single recipient exists.",
)
recipient: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A sub property of participant. The participant who is at the receiving end of the action.",
)
messageAttachment: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork attached to the message.",
)
ccRecipient: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A sub property of recipient. The recipient copied on a message.",
)
bccRecipient: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A sub property of recipient. The recipient blind copied on a message.",
)
dateRead: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date/time at which the message has been read by the recipient if a single recipient"
"exists.",
)
dateSent: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The date/time at which the message was sent.",
)
sender: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A sub property of participant. The participant who is at the sending end of the action.",
)
toRecipient: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A sub property of recipient. The recipient who was directly sent the message.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/EmailMessage.py
| 0.928075 | 0.318525 |
EmailMessage.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class OfferCatalog(BaseModel):
"""An OfferCatalog is an ItemList that contains related Offers and/or further OfferCatalogs that are offeredBy the same provider.
References:
https://schema.org/OfferCatalog
Note:
Model Depth 4
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
itemListOrder: (Union[List[Union[str, Any]], str, Any]): Type of ordering (e.g. Ascending, Descending, Unordered).
numberOfItems: (Optional[Union[List[Union[str, int, Any]], str, int, Any]]): The number of items in an ItemList. Note that some descriptions might not fully describe all items in a list (e.g., multi-page pagination); in such cases, the numberOfItems would be for the entire list.
itemListElement: (Union[List[Union[str, Any]], str, Any]): For itemListElement values, you can use simple strings (e.g. "Peter", "Paul", "Mary"), existing entities, or use ListItem.Text values are best if the elements in the list are plain strings. Existing entities are best for a simple, unordered list of existing things in your data. ListItem is used with ordered lists when you want to provide additional context about the element in that list or when the same item might be in different places in different lists.Note: The order of elements in your mark-up is not sufficient for indicating the order or elements. Use ListItem with a 'position' property in such cases.
"""
type_: str = Field(default="OfferCatalog", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
itemListOrder: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Type of ordering (e.g. Ascending, Descending, Unordered).",
)
numberOfItems: Optional[Union[List[Union[str, int, Any]], str, int, Any]] = Field(
default=None,
description="The number of items in an ItemList. Note that some descriptions might not fully describe"
"all items in a list (e.g., multi-page pagination); in such cases, the numberOfItems"
"would be for the entire list.",
)
itemListElement: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description='For itemListElement values, you can use simple strings (e.g. "Peter", "Paul",'
'"Mary"), existing entities, or use ListItem.Text values are best if the elements'
"in the list are plain strings. Existing entities are best for a simple, unordered list"
"of existing things in your data. ListItem is used with ordered lists when you want to provide"
"additional context about the element in that list or when the same item might be in different"
"places in different lists.Note: The order of elements in your mark-up is not sufficient"
"for indicating the order or elements. Use ListItem with a 'position' property in such"
"cases.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/OfferCatalog.py
| 0.949553 | 0.363139 |
OfferCatalog.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class PublicationIssue(BaseModel):
"""A part of a successively published publication such as a periodical or publication volume, often numbered, usually containing a grouping of works such as articles.See also [blog post](http://blog.schema.org/2014/09/schemaorg-support-for-bibliographic_2.html).
References:
https://schema.org/PublicationIssue
Note:
Model Depth 3
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
workTranslation: (Optional[Union[List[Union[str, Any]], str, Any]]): A work that is a translation of the content of this work. E.g. 西遊記 has an English workTranslation “Journey to the West”, a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.
educationalLevel: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The level in terms of progression through an educational or training context. Examples of educational levels include 'beginner', 'intermediate' or 'advanced', and formal sets of level indicators.
associatedMedia: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork. This property is a synonym for encoding.
exampleOfWork: (Optional[Union[List[Union[str, Any]], str, Any]]): A creative work that this work is an example/instance/realization/derivation of.
releasedEvent: (Optional[Union[List[Union[str, Any]], str, Any]]): The place and time the release was issued, expressed as a PublicationEvent.
version: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The version of the CreativeWork embodied by a specified resource.
locationCreated: (Optional[Union[List[Union[str, Any]], str, Any]]): The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.
acquireLicensePage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.
thumbnailUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A thumbnail image relevant to the Thing.
provider: (Optional[Union[List[Union[str, Any]], str, Any]]): The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller.
expires: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.
contentLocation: (Optional[Union[List[Union[str, Any]], str, Any]]): The location depicted or described in the content. For example, the location in a photograph or painting.
educationalUse: (Union[List[Union[str, Any]], str, Any]): The purpose of a work in the context of education; for example, 'assignment', 'group work'.
copyrightHolder: (Optional[Union[List[Union[str, Any]], str, Any]]): The party holding the legal copyright to the CreativeWork.
accessibilityControl: (Union[List[Union[str, Any]], str, Any]): Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).
maintainer: (Optional[Union[List[Union[str, Any]], str, Any]]): A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.
educationalAlignment: (Optional[Union[List[Union[str, Any]], str, Any]]): An alignment to an established educational framework.This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.
spatial: (Optional[Union[List[Union[str, Any]], str, Any]]): The "spatial" property can be used in cases when more specific properties(e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.
publisher: (Optional[Union[List[Union[str, Any]], str, Any]]): The publisher of the creative work.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
assesses: (Union[List[Union[str, Any]], str, Any]): The item being described is intended to assess the competency or learning outcome defined by the referenced term.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
isBasedOn: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A resource from which this work is derived or from which it is a modification or adaption.
mentions: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.
publishingPrinciples: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]].While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.
contributor: (Optional[Union[List[Union[str, Any]], str, Any]]): A secondary contributor to the CreativeWork or Event.
license: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A license document that applies to this content, typically indicated by URL.
citation: (Union[List[Union[str, Any]], str, Any]): A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.
accessibilitySummary: (Union[List[Union[str, Any]], str, Any]): A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."
award: (Union[List[Union[str, Any]], str, Any]): An award won by or for this item.
commentCount: (Optional[Union[List[Union[str, int, Any]], str, int, Any]]): The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.
temporalCoverage: (Union[List[Union[datetime, str, Any, AnyUrl]], datetime, str, Any, AnyUrl]): The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content, e.g. ScholarlyArticle, Book, TVSeries or TVEpisode, may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945".Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.
dateCreated: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date on which the CreativeWork was created or the item was added to a DataFeed.
discussionUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A link to the page containing the comments of the CreativeWork.
copyrightNotice: (Union[List[Union[str, Any]], str, Any]): Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.
learningResourceType: (Union[List[Union[str, Any]], str, Any]): The predominant type or kind characterizing the learning resource. For example, 'presentation', 'handout'.
awards: (Union[List[Union[str, Any]], str, Any]): Awards won by or for this item.
accessModeSufficient: (Optional[Union[List[Union[str, Any]], str, Any]]): A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
conditionsOfAccess: (Union[List[Union[str, Any]], str, Any]): Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language.For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".
interactivityType: (Union[List[Union[str, Any]], str, Any]): The predominant mode of learning supported by the learning resource. Acceptable values are 'active', 'expositive', or 'mixed'.
abstract: (Union[List[Union[str, Any]], str, Any]): An abstract is a short description that summarizes a [[CreativeWork]].
fileFormat: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content, e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, 'encoding' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.
interpretedAsClaim: (Optional[Union[List[Union[str, Any]], str, Any]]): Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].
text: (Union[List[Union[str, Any]], str, Any]): The textual content of this CreativeWork.
archivedAt: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.
alternativeHeadline: (Union[List[Union[str, Any]], str, Any]): A secondary title of the CreativeWork.
creditText: (Union[List[Union[str, Any]], str, Any]): Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
interactionStatistic: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.
workExample: (Optional[Union[List[Union[str, Any]], str, Any]]): Example/instance/realization/derivation of the concept of this creative work. E.g. the paperback edition, first edition, or e-book.
about: (Optional[Union[List[Union[str, Any]], str, Any]]): The subject matter of the content.
encodings: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork.
funder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports (sponsors) something through some kind of financial contribution.
video: (Optional[Union[List[Union[str, Any]], str, Any]]): An embedded video object.
isPartOf: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.
pattern: (Union[List[Union[str, Any]], str, Any]): A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'. Values are typically expressed as text, although links to controlled value schemes are also supported.
editor: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the Person who edited the CreativeWork.
dateModified: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date on which the CreativeWork was most recently modified or when the item's entry was modified within a DataFeed.
translationOfWork: (Optional[Union[List[Union[str, Any]], str, Any]]): The work that this work has been translated from. E.g. 物种起源 is a translationOf “On the Origin of Species”.
creativeWorkStatus: (Union[List[Union[str, Any]], str, Any]): The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.
isBasedOnUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.
isFamilyFriendly: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether this content is family friendly.
isAccessibleForFree: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the item, event, or place is accessible for free.
author: (Optional[Union[List[Union[str, Any]], str, Any]]): The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.
contentReferenceTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.
correction: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.
sdDatePublished: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]
comment: (Optional[Union[List[Union[str, Any]], str, Any]]): Comments, typically from users.
countryOfOrigin: (Optional[Union[List[Union[str, Any]], str, Any]]): The country of origin of something, including products as well as creative works such as movie and TV content.In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable.In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.
timeRequired: (Optional[Union[List[Union[str, Any]], str, Any]]): Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.
typicalAgeRange: (Union[List[Union[str, Any]], str, Any]): The typical expected age range, e.g. '7-9', '11-'.
genre: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Genre of the creative work, broadcast channel or group.
producer: (Optional[Union[List[Union[str, Any]], str, Any]]): The person or organization who produced the work (e.g. music album, movie, TV/radio series etc.).
schemaVersion: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.
audience: (Optional[Union[List[Union[str, Any]], str, Any]]): An intended audience, i.e. a group for whom something was created.
encoding: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.
publisherImprint: (Optional[Union[List[Union[str, Any]], str, Any]]): The publishing division which published the comic.
accessibilityAPI: (Union[List[Union[str, Any]], str, Any]): Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).
sdPublisher: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The[[sdPublisher]] property helps make such practices more explicit.
audio: (Optional[Union[List[Union[str, Any]], str, Any]]): An embedded audio object.
accessibilityFeature: (Union[List[Union[str, Any]], str, Any]): Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).
spatialCoverage: (Optional[Union[List[Union[str, Any]], str, Any]]): The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.
accessMode: (Union[List[Union[str, Any]], str, Any]): The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).
editEIDR: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television.For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J" has several edits, e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3".Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description.
usageInfo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information, e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options.This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.
position: (Union[List[Union[str, int, Any]], str, int, Any]): The position of an item in a series or sequence of items.
encodingFormat: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)), e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information.Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.
copyrightYear: (Optional[Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]]): The year during which the claimed copyright for the CreativeWork was first asserted.
mainEntity: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the primary entity described in some page or other CreativeWork.
creator: (Optional[Union[List[Union[str, Any]], str, Any]]): The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.
teaches: (Union[List[Union[str, Any]], str, Any]): The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.
temporal: (Union[List[Union[datetime, str, Any]], datetime, str, Any]): The "temporal" property can be used in cases where more specific properties(e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.
size: (Union[List[Union[str, Any]], str, Any]): A standardized size of a product or creative work, specified either through a simple textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable.
translator: (Optional[Union[List[Union[str, Any]], str, Any]]): Organization or person who adapts a creative work to different languages, regional differences and technical requirements of a target market, or that translates during some event.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
accountablePerson: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the Person that is legally accountable for the CreativeWork.
accessibilityHazard: (Union[List[Union[str, Any]], str, Any]): A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).
contentRating: (Union[List[Union[str, Any]], str, Any]): Official rating of a piece of content—for example, 'MPAA PG-13'.
recordedAt: (Optional[Union[List[Union[str, Any]], str, Any]]): The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.
publication: (Optional[Union[List[Union[str, Any]], str, Any]]): A publication event associated with the item.
sdLicense: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A license document that applies to this structured data, typically indicated by URL.
headline: (Union[List[Union[str, Any]], str, Any]): Headline of the article.
materialExtent: (Union[List[Union[str, Any]], str, Any]): The quantity of the materials being described or an expression of the physical space they occupy.
inLanguage: (Union[List[Union[str, Any]], str, Any]): The language of the content or performance or used in an action. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[availableLanguage]].
material: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): A material that something is made from, e.g. leather, wool, cotton, paper.
datePublished: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): Date of first broadcast/publication.
offers: (Optional[Union[List[Union[str, Any]], str, Any]]): An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]] to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can also be used to describe a [[Demand]]. While this property is listed as expected on a number of common types, it can be used in others. In that case, using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.
hasPart: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).
sourceOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): The Organization on whose behalf the creator was working.
sponsor: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.
character: (Optional[Union[List[Union[str, Any]], str, Any]]): Fictional person connected with a creative work.
pageEnd: (Union[List[Union[str, int, Any]], str, int, Any]): The page on which the work ends; for example "138" or "xvi".
issueNumber: (Union[List[Union[str, int, Any]], str, int, Any]): Identifies the issue of publication; for example, "iii" or "2".
pagination: (Union[List[Union[str, Any]], str, Any]): Any description of pages that is not separated into pageStart and pageEnd; for example, "1-6, 9, 55" or "10-12, 46-49".
pageStart: (Union[List[Union[str, int, Any]], str, int, Any]): The page on which the work starts; for example "135" or "xiii".
"""
type_: str = Field(default="PublicationIssue", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
workTranslation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A work that is a translation of the content of this work. E.g. 西遊記 has an English workTranslation"
"“Journey to the West”, a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese"
"translation Tây du ký bình khảo.",
)
educationalLevel: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The level in terms of progression through an educational or training context. Examples"
"of educational levels include 'beginner', 'intermediate' or 'advanced', and formal"
"sets of level indicators.",
)
associatedMedia: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork. This property is a synonym for encoding.",
)
exampleOfWork: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A creative work that this work is an example/instance/realization/derivation of.",
)
releasedEvent: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The place and time the release was issued, expressed as a PublicationEvent.",
)
version: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The version of the CreativeWork embodied by a specified resource.",
)
locationCreated: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The location where the CreativeWork was created, which may not be the same as the location"
"depicted in the CreativeWork.",
)
acquireLicensePage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page documenting how licenses can be purchased or otherwise acquired, for"
"the current item.",
)
thumbnailUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A thumbnail image relevant to the Thing.",
)
provider: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The service provider, service operator, or service performer; the goods producer."
"Another party (a seller) may offer those services or goods on behalf of the provider."
"A provider may also serve as the seller.",
)
expires: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="Date the content expires and is no longer useful or available. For example a [[VideoObject]]"
"or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]]"
"fact check whose publisher wants to indicate that it may no longer be relevant (or helpful"
"to highlight) after some date.",
)
contentLocation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The location depicted or described in the content. For example, the location in a photograph"
"or painting.",
)
educationalUse: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The purpose of a work in the context of education; for example, 'assignment', 'group"
"work'.",
)
copyrightHolder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The party holding the legal copyright to the CreativeWork.",
)
accessibilityControl: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Identifies input methods that are sufficient to fully control the described resource."
"Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).",
)
maintainer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other"
"[[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions"
"to, and/or publication of, some (typically complex) artifact. It is common for distributions"
'of software and data to be based on "upstream" sources. When [[maintainer]] is applied'
"to a specific version of something e.g. a particular version or packaging of a [[Dataset]],"
"it is always possible that the upstream source has a different maintainer. The [[isBasedOn]]"
"property can be used to indicate such relationships between datasets to make the different"
"maintenance roles clear. Similarly in the case of software, a package may have dedicated"
"maintainers working on integration into software distributions such as Ubuntu, as"
"well as upstream maintainers of the underlying work.",
)
educationalAlignment: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An alignment to an established educational framework.This property should not be used"
"where the nature of the alignment can be described using a simple property, for example"
"to express that a resource [[teaches]] or [[assesses]] a competency.",
)
spatial: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description='The "spatial" property can be used in cases when more specific properties(e.g. [[locationCreated]],'
"[[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.",
)
publisher: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The publisher of the creative work.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
assesses: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The item being described is intended to assess the competency or learning outcome defined"
"by the referenced term.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
isBasedOn: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A resource from which this work is derived or from which it is a modification or adaption.",
)
mentions: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates that the CreativeWork contains a reference to, but is not necessarily about"
"a concept.",
)
publishingPrinciples: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing"
"the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]]"
"writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity"
"policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles"
"are those of the party primarily responsible for the creation of the [[CreativeWork]].While"
"such policies are most typically expressed in natural language, sometimes related"
"information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.",
)
contributor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A secondary contributor to the CreativeWork or Event.",
)
license: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A license document that applies to this content, typically indicated by URL.",
)
citation: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A citation or reference to another creative work, such as another publication, web page,"
"scholarly article, etc.",
)
accessibilitySummary: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A human-readable summary of specific accessibility features or deficiencies, consistent"
'with the other accessibility metadata but expressing subtleties such as "short descriptions'
'are present but long descriptions will be needed for non-visual users" or "short descriptions'
'are present and no long descriptions are needed."',
)
award: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An award won by or for this item.",
)
commentCount: Optional[Union[List[Union[str, int, Any]], str, int, Any]] = Field(
default=None,
description="The number of comments this CreativeWork (e.g. Article, Question or Answer) has received."
"This is most applicable to works published in Web sites with commenting system; additional"
"comments may exist elsewhere.",
)
temporalCoverage: Union[
List[Union[datetime, str, Any, AnyUrl]], datetime, str, Any, AnyUrl
] = Field(
default=None,
description="The temporalCoverage of a CreativeWork indicates the period that the content applies"
"to, i.e. that it describes, either as a DateTime or as a textual string indicating a time"
"period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals)."
"In the case of a Dataset it will typically indicate the relevant time period in a precise"
'notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012").'
"Other forms of content, e.g. ScholarlyArticle, Book, TVSeries or TVEpisode, may indicate"
"their temporalCoverage in broader terms - textually or via well-known URL. Written"
"works such as books may sometimes have precise temporal coverage too, e.g. a work set"
'in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945".Open-ended'
'date ranges can be written with ".." in place of the end date. For example, "2015-11/.."'
"indicates a range beginning in November 2015 and with no specified final date. This is"
"tentative and might be updated in future when ISO 8601 is officially updated.",
)
dateCreated: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date on which the CreativeWork was created or the item was added to a DataFeed.",
)
discussionUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A link to the page containing the comments of the CreativeWork.",
)
copyrightNotice: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Text of a notice appropriate for describing the copyright aspects of this Creative Work,"
"ideally indicating the owner of the copyright for the Work.",
)
learningResourceType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The predominant type or kind characterizing the learning resource. For example, 'presentation',"
"'handout'.",
)
awards: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Awards won by or for this item.",
)
accessModeSufficient: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A list of single or combined accessModes that are sufficient to understand all the intellectual"
"content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
conditionsOfAccess: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Conditions that affect the availability of, or method(s) of access to, an item. Typically"
"used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]."
"This property is not suitable for use as a general Web access control mechanism. It is"
'expressed only in natural language.For example "Available by appointment from the'
'Reading Room" or "Accessible only from logged-in accounts ".',
)
interactivityType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The predominant mode of learning supported by the learning resource. Acceptable values"
"are 'active', 'expositive', or 'mixed'.",
)
abstract: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An abstract is a short description that summarizes a [[CreativeWork]].",
)
fileFormat: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml))"
"of the content, e.g. application/zip of a SoftwareApplication binary. In cases where"
"a CreativeWork has several media type representations, 'encoding' can be used to indicate"
"each MediaObject alongside particular fileFormat information. Unregistered or niche"
"file formats can be indicated instead via the most appropriate URL, e.g. defining Web"
"page or a Wikipedia entry.",
)
interpretedAsClaim: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Used to indicate a specific claim contained, implied, translated or refined from the"
"content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can"
"be indicated using [[claimInterpreter]].",
)
text: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The textual content of this CreativeWork.",
)
archivedAt: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case"
"of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible,"
"but be archived by archival, journalistic, activist, or law enforcement organizations."
"In such cases, the referenced page may not directly publish the content.",
)
alternativeHeadline: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A secondary title of the CreativeWork.",
)
creditText: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Text that can be used to credit person(s) and/or organization(s) associated with a published"
"Creative Work.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
interactionStatistic: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication."
"The most specific child type of InteractionCounter should be used.",
)
workExample: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Example/instance/realization/derivation of the concept of this creative work. E.g."
"the paperback edition, first edition, or e-book.",
)
about: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The subject matter of the content.",
)
encodings: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork.",
)
funder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports (sponsors) something through some kind of financial"
"contribution.",
)
video: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An embedded video object.",
)
isPartOf: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is"
"part of.",
)
pattern: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'."
"Values are typically expressed as text, although links to controlled value schemes"
"are also supported.",
)
editor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the Person who edited the CreativeWork.",
)
dateModified: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date on which the CreativeWork was most recently modified or when the item's entry"
"was modified within a DataFeed.",
)
translationOfWork: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The work that this work has been translated from. E.g. 物种起源 is a translationOf “On the"
"Origin of Species”.",
)
creativeWorkStatus: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The status of a creative work in terms of its stage in a lifecycle. Example terms include"
"Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for"
"the stages of their publication lifecycle.",
)
isBasedOnUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A resource that was used in the creation of this resource. This term can be repeated for"
"multiple sources. For example, http://example.com/great-multiplication-intro.html.",
)
isFamilyFriendly: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether this content is family friendly.",
)
isAccessibleForFree: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the item, event, or place is accessible for free.",
)
author: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The author of this content or rating. Please note that author is special in that HTML 5"
"provides a special mechanism for indicating authorship via the rel tag. That is equivalent"
"to this and may be used interchangeably.",
)
contentReferenceTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The specific time described by a creative work, for works (e.g. articles, video objects"
"etc.) that emphasise a particular moment within an Event.",
)
correction: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]],"
"textually or in another document.",
)
sdDatePublished: Optional[
Union[List[Union[str, Any, date]], str, Any, date]
] = Field(
default=None,
description="Indicates the date on which the current structured data was generated / published. Typically"
"used alongside [[sdPublisher]]",
)
comment: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Comments, typically from users.",
)
countryOfOrigin: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The country of origin of something, including products as well as creative works such"
"as movie and TV content.In the case of TV and movie, this would be the country of the principle"
"offices of the production company or individual responsible for the movie. For other"
"kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties"
"such as [[contentLocation]] and [[locationCreated]] may be more applicable.In the"
"case of products, the country of origin of the product. The exact interpretation of this"
"may vary by context and product type, and cannot be fully enumerated here.",
)
timeRequired: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Approximate or typical time it takes to work with or through this learning resource for"
"the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.",
)
typicalAgeRange: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The typical expected age range, e.g. '7-9', '11-'.",
)
genre: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Genre of the creative work, broadcast channel or group.",
)
producer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The person or organization who produced the work (e.g. music album, movie, TV/radio"
"series etc.).",
)
schemaVersion: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Indicates (by URL or string) a particular version of a schema used in some CreativeWork."
"This property was created primarily to indicate the use of a specific schema.org release,"
"e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```."
"There may be situations in which other schemas might usefully be referenced this way,"
"e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/```"
"but this has not been carefully explored in the community.",
)
audience: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An intended audience, i.e. a group for whom something was created.",
)
encoding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.",
)
publisherImprint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The publishing division which published the comic.",
)
accessibilityAPI: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Indicates that the resource is compatible with the referenced accessibility API. Values"
"should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).",
)
sdPublisher: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the party responsible for generating and publishing the current structured"
"data markup, typically in cases where the structured data is derived automatically"
"from existing published content but published on a different site. For example, student"
"projects and open data initiatives often re-publish existing content with more explicitly"
"structured metadata. The[[sdPublisher]] property helps make such practices more"
"explicit.",
)
audio: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An embedded audio object.",
)
accessibilityFeature: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Content features of the resource, such as accessible media, alternatives and supported"
"enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).",
)
spatialCoverage: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of"
"the content. It is a subproperty of contentLocation intended primarily for more technical"
"and detailed materials. For example with a Dataset, it indicates areas that the dataset"
"describes: a dataset of New York weather would have spatialCoverage which was the place:"
"the state of New York.",
)
accessMode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The human sensory perceptual system or cognitive faculty through which a person may"
"process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).",
)
editEIDR: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]]"
"representing a specific edit / edition for a work of film or television.For example,"
'the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J"'
'has several edits, e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3".Since'
"schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their"
"multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description),"
"or alongside [[editEIDR]] for a more edit-specific description.",
)
usageInfo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]."
"This property is applicable both to works that are freely available and to those that"
"require payment or other transactions. It can reference additional information, e.g."
"community expectations on preferred linking and citation conventions, as well as purchasing"
"details. For something that can be commercially licensed, usageInfo can provide detailed,"
"resource-specific information about licensing options.This property can be used"
"alongside the license property which indicates license(s) applicable to some piece"
"of content. The usageInfo property can provide information about other licensing options,"
"e.g. acquiring commercial usage rights for an image that is also available under non-commercial"
"creative commons licenses.",
)
position: Union[List[Union[str, int, Any]], str, int, Any] = Field(
default=None,
description="The position of an item in a series or sequence of items.",
)
encodingFormat: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)"
"and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)),"
"e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In"
"cases where a [[CreativeWork]] has several media type representations, [[encoding]]"
"can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]]"
"information.Unregistered or niche encoding and file formats can be indicated instead"
"via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.",
)
copyrightYear: Optional[
Union[
List[Union[str, Any, StrictInt, StrictFloat]],
str,
Any,
StrictInt,
StrictFloat,
]
] = Field(
default=None,
description="The year during which the claimed copyright for the CreativeWork was first asserted.",
)
mainEntity: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the primary entity described in some page or other CreativeWork.",
)
creator: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The creator/author of this CreativeWork. This is the same as the Author property for"
"CreativeWork.",
)
teaches: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The item being described is intended to help a person learn the competency or learning"
"outcome defined by the referenced term.",
)
temporal: Union[List[Union[datetime, str, Any]], datetime, str, Any] = Field(
default=None,
description='The "temporal" property can be used in cases where more specific properties(e.g.'
"[[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]])"
"are not known to be appropriate.",
)
size: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A standardized size of a product or creative work, specified either through a simple"
"textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode,"
"or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]],"
"[[height]], [[depth]] and [[weight]] properties may be more applicable.",
)
translator: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Organization or person who adapts a creative work to different languages, regional"
"differences and technical requirements of a target market, or that translates during"
"some event.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
accountablePerson: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the Person that is legally accountable for the CreativeWork.",
)
accessibilityHazard: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A characteristic of the described resource that is physiologically dangerous to some"
"users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).",
)
contentRating: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Official rating of a piece of content—for example, 'MPAA PG-13'.",
)
recordedAt: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The Event where the CreativeWork was recorded. The CreativeWork may capture all or part"
"of the event.",
)
publication: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A publication event associated with the item.",
)
sdLicense: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A license document that applies to this structured data, typically indicated by URL.",
)
headline: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Headline of the article.",
)
materialExtent: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The quantity of the materials being described or an expression of the physical space"
"they occupy.",
)
inLanguage: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The language of the content or performance or used in an action. Please use one of the language"
"codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also"
"[[availableLanguage]].",
)
material: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="A material that something is made from, e.g. leather, wool, cotton, paper.",
)
datePublished: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="Date of first broadcast/publication.",
)
offers: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An offer to provide this item—for example, an offer to sell a product, rent the"
"DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]"
"to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can"
"also be used to describe a [[Demand]]. While this property is listed as expected on a number"
"of common types, it can be used in others. In that case, using a second type, such as Product"
"or a subtype of Product, can clarify the nature of the offer.",
)
hasPart: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some"
"sense).",
)
sourceOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The Organization on whose behalf the creator was working.",
)
sponsor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports a thing through a pledge, promise, or financial"
"contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.",
)
character: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Fictional person connected with a creative work.",
)
pageEnd: Union[List[Union[str, int, Any]], str, int, Any] = Field(
default=None,
description='The page on which the work ends; for example "138" or "xvi".',
)
issueNumber: Union[List[Union[str, int, Any]], str, int, Any] = Field(
default=None,
description='Identifies the issue of publication; for example, "iii" or "2".',
)
pagination: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Any description of pages that is not separated into pageStart and pageEnd; for example,"
'"1-6, 9, 55" or "10-12, 46-49".',
)
pageStart: Union[List[Union[str, int, Any]], str, int, Any] = Field(
default=None,
description='The page on which the work starts; for example "135" or "xiii".',
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/PublicationIssue.py
| 0.929007 | 0.414069 |
PublicationIssue.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class MerchantReturnPolicySeasonalOverride(BaseModel):
"""A seasonal override of a return policy, for example used for holidays.
References:
https://schema.org/MerchantReturnPolicySeasonalOverride
Note:
Model Depth 3
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
returnPolicyCategory: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies an applicable return policy (from an enumeration).
merchantReturnDays: (Optional[Union[List[Union[datetime, date, int, str, Any]], datetime, date, int, str, Any]]): Specifies either a fixed return date or the number of days (from the delivery date) that a product can be returned. Used when the [[returnPolicyCategory]] property is specified as [[MerchantReturnFiniteReturnWindow]].
startDate: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).
endDate: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).
"""
type_: str = Field(
default="MerchantReturnPolicySeasonalOverride", alias="@type", const=True
)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
returnPolicyCategory: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies an applicable return policy (from an enumeration).",
)
merchantReturnDays: Optional[
Union[List[Union[datetime, date, int, str, Any]], datetime, date, int, str, Any]
] = Field(
default=None,
description="Specifies either a fixed return date or the number of days (from the delivery date) that"
"a product can be returned. Used when the [[returnPolicyCategory]] property is specified"
"as [[MerchantReturnFiniteReturnWindow]].",
)
startDate: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).",
)
endDate: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/MerchantReturnPolicySeasonalOverride.py
| 0.945525 | 0.303554 |
MerchantReturnPolicySeasonalOverride.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class MedicalDevicePurpose(BaseModel):
"""Categories of medical devices, organized by the purpose or intended use of the device.
References:
https://schema.org/MedicalDevicePurpose
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
supersededBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Relates a term (i.e. a property, class or enumeration) to one that supersedes it.
"""
type_: str = Field(default="MedicalDevicePurpose", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
supersededBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/MedicalDevicePurpose.py
| 0.946621 | 0.318485 |
MedicalDevicePurpose.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class DrivingSchoolVehicleUsage(BaseModel):
"""Indicates the usage of the vehicle for driving school.
References:
https://schema.org/DrivingSchoolVehicleUsage
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
supersededBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Relates a term (i.e. a property, class or enumeration) to one that supersedes it.
"""
type_: str = Field(default="DrivingSchoolVehicleUsage", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
supersededBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/DrivingSchoolVehicleUsage.py
| 0.944677 | 0.360067 |
DrivingSchoolVehicleUsage.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class HousePainter(BaseModel):
"""A house painting service.
References:
https://schema.org/HousePainter
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
serviceArea: (Optional[Union[List[Union[str, Any]], str, Any]]): The geographic area where the service is provided.
founder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person who founded this organization.
isicV4: (Union[List[Union[str, Any]], str, Any]): The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.
hasPOS: (Optional[Union[List[Union[str, Any]], str, Any]]): Points-of-Sales operated by the organization or person.
globalLocationNumber: (Union[List[Union[str, Any]], str, Any]): The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.
member: (Optional[Union[List[Union[str, Any]], str, Any]]): A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.
knowsAbout: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.
makesOffer: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to products or services offered by the organization or person.
ownershipFundingInfo: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.
founders: (Optional[Union[List[Union[str, Any]], str, Any]]): A person who founded this organization.
legalName: (Union[List[Union[str, Any]], str, Any]): The official name of the organization, e.g. the registered company name.
actionableFeedbackPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.
areaServed: (Union[List[Union[str, Any]], str, Any]): The geographic area where a service or offered item is provided.
parentOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): The larger organization that this organization is a [[subOrganization]] of, if any.
slogan: (Union[List[Union[str, Any]], str, Any]): A slogan or motto associated with the item.
department: (Optional[Union[List[Union[str, Any]], str, Any]]): A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
memberOf: (Optional[Union[List[Union[str, Any]], str, Any]]): An Organization (or ProgramMembership) to which this Person or Organization belongs.
publishingPrinciples: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]].While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.
employee: (Optional[Union[List[Union[str, Any]], str, Any]]): Someone working for this organization.
award: (Union[List[Union[str, Any]], str, Any]): An award won by or for this item.
email: (Union[List[Union[str, Any]], str, Any]): Email address.
contactPoints: (Optional[Union[List[Union[str, Any]], str, Any]]): A contact point for a person or organization.
diversityStaffingReport: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.
foundingDate: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): The date that this organization was founded.
owns: (Optional[Union[List[Union[str, Any]], str, Any]]): Products owned by the organization or person.
awards: (Union[List[Union[str, Any]], str, Any]): Awards won by or for this item.
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
dissolutionDate: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): The date that this organization was dissolved.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
interactionStatistic: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.
events: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past events associated with this place or organization.
seeks: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to products or services sought by the organization or person (demand).
employees: (Optional[Union[List[Union[str, Any]], str, Any]]): People working for this organization.
unnamedSourcesPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.
subOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific 'department' property.
foundingLocation: (Optional[Union[List[Union[str, Any]], str, Any]]): The place where the Organization was founded.
funder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports (sponsors) something through some kind of financial contribution.
iso6523Code: (Union[List[Union[str, Any]], str, Any]): An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly.
diversityPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.
hasMerchantReturnPolicy: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies a MerchantReturnPolicy that may be applicable.
event: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past event associated with this place, organization, or action.
duns: (Union[List[Union[str, Any]], str, Any]): The Dun & Bradstreet DUNS number for identifying an organization or business person.
alumni: (Optional[Union[List[Union[str, Any]], str, Any]]): Alumni of an organization.
ethicsPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.
leiCode: (Union[List[Union[str, Any]], str, Any]): An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.
vatID: (Union[List[Union[str, Any]], str, Any]): The Value-added Tax ID of the organization or person.
knowsLanguage: (Union[List[Union[str, Any]], str, Any]): Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).
correctionsPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.
logo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An associated logo.
hasCredential: (Optional[Union[List[Union[str, Any]], str, Any]]): A credential awarded to the Person or Organization.
address: (Union[List[Union[str, Any]], str, Any]): Physical address of the item.
brand: (Optional[Union[List[Union[str, Any]], str, Any]]): The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.
nonprofitStatus: (Optional[Union[List[Union[str, Any]], str, Any]]): nonprofitStatus indicates the legal status of a non-profit organization in its primary place of business.
contactPoint: (Optional[Union[List[Union[str, Any]], str, Any]]): A contact point for a person or organization.
hasOfferCatalog: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates an OfferCatalog listing for this Organization, Person, or Service.
members: (Optional[Union[List[Union[str, Any]], str, Any]]): A member of this organization.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
faxNumber: (Union[List[Union[str, Any]], str, Any]): The fax number.
telephone: (Union[List[Union[str, Any]], str, Any]): The telephone number.
taxID: (Union[List[Union[str, Any]], str, Any]): The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.
naics: (Union[List[Union[str, Any]], str, Any]): The North American Industry Classification System (NAICS) code for a particular organization or business person.
location: (Union[List[Union[str, Any]], str, Any]): The location of, for example, where an event is happening, where an organization is located, or where an action takes place.
numberOfEmployees: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of employees in an organization, e.g. business.
sponsor: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
geoCovers: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
longitude: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).
smokingAllowed: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.
isicV4: (Union[List[Union[str, Any]], str, Any]): The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.
globalLocationNumber: (Union[List[Union[str, Any]], str, Any]): The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.
amenityFeature: (Optional[Union[List[Union[str, Any]], str, Any]]): An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.
additionalProperty: (Optional[Union[List[Union[str, Any]], str, Any]]): A property-value pair representing an additional characteristic of the entity, e.g. a product feature or another characteristic for which there is no matching property in schema.org.Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.
slogan: (Union[List[Union[str, Any]], str, Any]): A slogan or motto associated with the item.
photos: (Optional[Union[List[Union[str, Any]], str, Any]]): Photographs of this place.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
tourBookingPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.
geoWithin: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
containsPlace: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and another that it contains.
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
hasMap: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
containedIn: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and one that contains it.
events: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past events associated with this place or organization.
geoOverlaps: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
geoEquals: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship).
maps: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
isAccessibleForFree: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the item, event, or place is accessible for free.
event: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past event associated with this place, organization, or action.
photo: (Optional[Union[List[Union[str, Any]], str, Any]]): A photograph of this place.
containedInPlace: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and one that contains it.
logo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An associated logo.
geoCrosses: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
address: (Union[List[Union[str, Any]], str, Any]): Physical address of the item.
geo: (Optional[Union[List[Union[str, Any]], str, Any]]): The geo coordinates of the place.
openingHoursSpecification: (Optional[Union[List[Union[str, Any]], str, Any]]): The opening hours of a certain place.
geoDisjoint: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: "they have no point in common. They form a set of disconnected geometries." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)
geoIntersects: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
latitude: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).
maximumAttendeeCapacity: (Optional[Union[List[Union[str, int, Any]], str, int, Any]]): The total number of individuals that may attend an event or venue.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
map: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
branchCode: (Union[List[Union[str, Any]], str, Any]): A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs.For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.
faxNumber: (Union[List[Union[str, Any]], str, Any]): The fax number.
publicAccess: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value
geoTouches: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) touch: "they have at least one boundary point in common, but no interior points." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)
geoCoveredBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
telephone: (Union[List[Union[str, Any]], str, Any]): The telephone number.
hasDriveThroughService: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.
specialOpeningHoursSpecification: (Optional[Union[List[Union[str, Any]], str, Any]]): The special opening hours of a certain place.Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]].
geoContains: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
priceRange: (Union[List[Union[str, Any]], str, Any]): The price range of the business, for example ```$$$```.
currenciesAccepted: (Union[List[Union[str, Any]], str, Any]): The currency accepted.Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217), e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types, e.g. "Ithaca HOUR".
branchOf: (Optional[Union[List[Union[str, Any]], str, Any]]): The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical) [[branch]].
paymentAccepted: (Union[List[Union[str, Any]], str, Any]): Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.
openingHours: (Union[List[Union[str, Any]], str, Any]): The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas ',' separating each day. Day or time ranges are specified using a hyphen '-'.* Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```.* Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: <code><time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays and Thursdays 4-8pm</time></code>.* If a business is open 7 days a week, then it can be specified as <code><time itemprop="openingHours" datetime="Mo-Su">Monday through Sunday, all day</time></code>.
"""
type_: str = Field(default="HousePainter", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
serviceArea: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The geographic area where the service is provided.",
)
founder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person who founded this organization.",
)
isicV4: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The International Standard of Industrial Classification of All Economic Activities"
"(ISIC), Revision 4 code for a particular organization, business person, or place.",
)
hasPOS: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Points-of-Sales operated by the organization or person.",
)
globalLocationNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred"
"to as International Location Number or ILN) of the respective organization, person,"
"or place. The GLN is a 13-digit number used to identify parties and physical locations.",
)
member: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A member of an Organization or a ProgramMembership. Organizations can be members of"
"organizations; ProgramMembership is typically for individuals.",
)
knowsAbout: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that"
"is known about - suggesting possible expertise but not implying it. We do not distinguish"
"skill levels here, or relate this to educational content, events, objectives or [[JobPosting]]"
"descriptions.",
)
makesOffer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to products or services offered by the organization or person.",
)
ownershipFundingInfo: Union[
List[Union[str, AnyUrl, Any]], str, AnyUrl, Any
] = Field(
default=None,
description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]),"
"a description of organizational ownership structure; funding and grants. In a news/media"
"setting, this is with particular reference to editorial independence. Note that the"
"[[funder]] is also available and can be used to make basic funder information machine-readable.",
)
founders: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person who founded this organization.",
)
legalName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The official name of the organization, e.g. the registered company name.",
)
actionableFeedbackPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement"
"about public engagement activities (for news media, the newsroom’s), including involving"
"the public - digitally or otherwise -- in coverage decisions, reporting and activities"
"after publication.",
)
areaServed: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The geographic area where a service or offered item is provided.",
)
parentOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The larger organization that this organization is a [[subOrganization]] of, if any.",
)
slogan: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A slogan or motto associated with the item.",
)
department: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A relationship between an organization and a department of that organization, also"
"described as an organization (allowing different urls, logos, opening hours). For"
"example: a store with a pharmacy, or a bakery with a cafe.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
memberOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An Organization (or ProgramMembership) to which this Person or Organization belongs.",
)
publishingPrinciples: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing"
"the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]]"
"writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity"
"policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles"
"are those of the party primarily responsible for the creation of the [[CreativeWork]].While"
"such policies are most typically expressed in natural language, sometimes related"
"information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.",
)
employee: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Someone working for this organization.",
)
award: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An award won by or for this item.",
)
email: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Email address.",
)
contactPoints: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A contact point for a person or organization.",
)
diversityStaffingReport: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]),"
"a report on staffing diversity issues. In a news context this might be for example ASNE"
"or RTDNA (US) reports, or self-reported.",
)
foundingDate: Optional[Union[List[Union[str, Any, date]], str, Any, date]] = Field(
default=None,
description="The date that this organization was founded.",
)
owns: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Products owned by the organization or person.",
)
awards: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Awards won by or for this item.",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
dissolutionDate: Optional[
Union[List[Union[str, Any, date]], str, Any, date]
] = Field(
default=None,
description="The date that this organization was dissolved.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
interactionStatistic: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication."
"The most specific child type of InteractionCounter should be used.",
)
events: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past events associated with this place or organization.",
)
seeks: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to products or services sought by the organization or person (demand).",
)
employees: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="People working for this organization.",
)
unnamedSourcesPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about"
"policy on use of unnamed sources and the decision process required.",
)
subOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A relationship between two organizations where the first includes the second, e.g.,"
"as a subsidiary. See also: the more specific 'department' property.",
)
foundingLocation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The place where the Organization was founded.",
)
funder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports (sponsors) something through some kind of financial"
"contribution.",
)
iso6523Code: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An organization identifier as defined in ISO 6523(-1). Note that many existing organization"
"identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns)"
"and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier"
"by setting the ICD part of the ISO 6523 identifier accordingly.",
)
diversityPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]."
"For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity"
"policy on both staffing and sources, typically providing staffing data.",
)
hasMerchantReturnPolicy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies a MerchantReturnPolicy that may be applicable.",
)
event: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past event associated with this place, organization, or action.",
)
duns: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Dun & Bradstreet DUNS number for identifying an organization or business person.",
)
alumni: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Alumni of an organization.",
)
ethicsPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic"
"and publishing practices, or of a [[Restaurant]], a page describing food source policies."
"In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement"
"describing the personal, organizational, and corporate standards of behavior expected"
"by the organization.",
)
leiCode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An organization identifier that uniquely identifies a legal entity as defined in ISO"
"17442.",
)
vatID: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Value-added Tax ID of the organization or person.",
)
knowsLanguage: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Of a [[Person]], and less typically of an [[Organization]], to indicate a known language."
"We do not distinguish skill levels or reading/writing/speaking/signing here. Use"
"language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).",
)
correctionsPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing"
"(in news media, the newsroom’s) disclosure and correction policy for errors.",
)
logo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An associated logo.",
)
hasCredential: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A credential awarded to the Person or Organization.",
)
address: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Physical address of the item.",
)
brand: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The brand(s) associated with a product or service, or the brand(s) maintained by an organization"
"or business person.",
)
nonprofitStatus: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="nonprofitStatus indicates the legal status of a non-profit organization in its primary"
"place of business.",
)
contactPoint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A contact point for a person or organization.",
)
hasOfferCatalog: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates an OfferCatalog listing for this Organization, Person, or Service.",
)
members: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A member of this organization.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
faxNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The fax number.",
)
telephone: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The telephone number.",
)
taxID: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in"
"Spain.",
)
naics: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The North American Industry Classification System (NAICS) code for a particular organization"
"or business person.",
)
location: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The location of, for example, where an event is happening, where an organization is located,"
"or where an action takes place.",
)
numberOfEmployees: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of employees in an organization, e.g. business.",
)
sponsor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports a thing through a pledge, promise, or financial"
"contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.",
)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
geoCovers: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a covering geometry to a covered geometry. "Every point of b is a point of (the interior'
'or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).',
)
longitude: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).",
)
smokingAllowed: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or"
"hotel room.",
)
isicV4: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The International Standard of Industrial Classification of All Economic Activities"
"(ISIC), Revision 4 code for a particular organization, business person, or place.",
)
globalLocationNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred"
"to as International Location Number or ILN) of the respective organization, person,"
"or place. The GLN is a 13-digit number used to identify parties and physical locations.",
)
amenityFeature: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic"
"property does not make a statement about whether the feature is included in an offer for"
"the main accommodation or available at extra costs.",
)
additionalProperty: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A property-value pair representing an additional characteristic of the entity, e.g."
"a product feature or another characteristic for which there is no matching property"
"in schema.org.Note: Publishers should be aware that applications designed to use specific"
"schema.org properties (e.g. https://schema.org/width, https://schema.org/color,"
"https://schema.org/gtin13, ...) will typically expect such data to be provided using"
"those properties, rather than using the generic property/value mechanism.",
)
slogan: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A slogan or motto associated with the item.",
)
photos: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Photographs of this place.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
tourBookingPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]]"
"or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.",
)
geoWithin: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined"
"in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
containsPlace: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and another that it contains.",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
hasMap: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
containedIn: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and one that contains it.",
)
events: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past events associated with this place or organization.",
)
geoOverlaps: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to another that geospatially overlaps it, i.e. they have some but not all points"
"in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
geoEquals: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
"are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM)."
'"Two geometries are topologically equal if their interiors intersect and no part of'
'the interior or boundary of one geometry intersects the exterior of the other" (a symmetric'
"relationship).",
)
maps: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
isAccessibleForFree: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the item, event, or place is accessible for free.",
)
event: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past event associated with this place, organization, or action.",
)
photo: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A photograph of this place.",
)
containedInPlace: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and one that contains it.",
)
logo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An associated logo.",
)
geoCrosses: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a geometry to another that crosses it: "a crosses b: they have some but not all interior'
"points in common, and the dimension of the intersection is less than that of at least one"
'of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).',
)
address: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Physical address of the item.",
)
geo: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The geo coordinates of the place.",
)
openingHoursSpecification: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The opening hours of a certain place.",
)
geoDisjoint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
'are topologically disjoint: "they have no point in common. They form a set of disconnected'
'geometries." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)',
)
geoIntersects: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
"have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
latitude: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).",
)
maximumAttendeeCapacity: Optional[
Union[List[Union[str, int, Any]], str, int, Any]
] = Field(
default=None,
description="The total number of individuals that may attend an event or venue.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
map: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
branchCode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description='A short textual code (also called "store code") that uniquely identifies a place of'
"business. The code is typically assigned by the parentOrganization and used in structured"
"URLs.For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047"
'the code "3047" is a branchCode for a particular branch.',
)
faxNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The fax number.",
)
publicAccess: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the [[Place]] is open to public visitors. If this property is omitted"
"there is no assumed default boolean value",
)
geoTouches: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
'touch: "they have at least one boundary point in common, but no interior points." (A'
"symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)",
)
geoCoveredBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
telephone: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The telephone number.",
)
hasDriveThroughService: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]])"
"offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]]"
"such facilities could potentially help with social distancing from other potentially-infected"
"users.",
)
specialOpeningHoursSpecification: Optional[
Union[List[Union[str, Any]], str, Any]
] = Field(
default=None,
description="The special opening hours of a certain place.Use this to explicitly override general"
"opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]].",
)
geoContains: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a containing geometry to a contained geometry. "a contains b iff no points of b lie in'
'the exterior of a, and at least one point of the interior of b lies in the interior of a".'
"As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
priceRange: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The price range of the business, for example ```$$$```.",
)
currenciesAccepted: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The currency accepted.Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217),"
'e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies)'
'for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system)'
'(LETS) and other currency types, e.g. "Ithaca HOUR".',
)
branchOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The larger organization that this local business is a branch of, if any. Not to be confused"
"with (anatomical) [[branch]].",
)
paymentAccepted: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.",
)
openingHours: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The general opening hours for a business. Opening hours can be specified as a weekly time"
"range, starting with days, then times per day. Multiple days can be listed with commas"
"',' separating each day. Day or time ranges are specified using a hyphen '-'.* Days are"
"specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```,"
"```Th```, ```Fr```, ```Sa```, ```Su```.* Times are specified using 24:00 format."
"For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example:"
'<code><time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays'
"and Thursdays 4-8pm</time></code>.* If a business is open 7 days a week, then"
"it can be specified as <code><time itemprop="openingHours" datetime="Mo-Su">Monday"
"through Sunday, all day</time></code>.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/HousePainter.py
| 0.885248 | 0.355887 |
HousePainter.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class Language(BaseModel):
"""Natural languages such as Spanish, Tamil, Hindi, English, etc. Formal language code tags expressed in [BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) can be used via the [[alternateName]] property. The Language type previously also covered programming languages such as Scheme and Lisp, which are now best represented using [[ComputerLanguage]].
References:
https://schema.org/Language
Note:
Model Depth 3
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
"""
type_: str = Field(default="Language", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/Language.py
| 0.9439 | 0.408454 |
Language.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class AnimalShelter(BaseModel):
"""Animal shelter.
References:
https://schema.org/AnimalShelter
Note:
Model Depth 4
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
serviceArea: (Optional[Union[List[Union[str, Any]], str, Any]]): The geographic area where the service is provided.
founder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person who founded this organization.
isicV4: (Union[List[Union[str, Any]], str, Any]): The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.
hasPOS: (Optional[Union[List[Union[str, Any]], str, Any]]): Points-of-Sales operated by the organization or person.
globalLocationNumber: (Union[List[Union[str, Any]], str, Any]): The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.
member: (Optional[Union[List[Union[str, Any]], str, Any]]): A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.
knowsAbout: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.
makesOffer: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to products or services offered by the organization or person.
ownershipFundingInfo: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.
founders: (Optional[Union[List[Union[str, Any]], str, Any]]): A person who founded this organization.
legalName: (Union[List[Union[str, Any]], str, Any]): The official name of the organization, e.g. the registered company name.
actionableFeedbackPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.
areaServed: (Union[List[Union[str, Any]], str, Any]): The geographic area where a service or offered item is provided.
parentOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): The larger organization that this organization is a [[subOrganization]] of, if any.
slogan: (Union[List[Union[str, Any]], str, Any]): A slogan or motto associated with the item.
department: (Optional[Union[List[Union[str, Any]], str, Any]]): A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
memberOf: (Optional[Union[List[Union[str, Any]], str, Any]]): An Organization (or ProgramMembership) to which this Person or Organization belongs.
publishingPrinciples: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]].While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.
employee: (Optional[Union[List[Union[str, Any]], str, Any]]): Someone working for this organization.
award: (Union[List[Union[str, Any]], str, Any]): An award won by or for this item.
email: (Union[List[Union[str, Any]], str, Any]): Email address.
contactPoints: (Optional[Union[List[Union[str, Any]], str, Any]]): A contact point for a person or organization.
diversityStaffingReport: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.
foundingDate: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): The date that this organization was founded.
owns: (Optional[Union[List[Union[str, Any]], str, Any]]): Products owned by the organization or person.
awards: (Union[List[Union[str, Any]], str, Any]): Awards won by or for this item.
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
dissolutionDate: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): The date that this organization was dissolved.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
interactionStatistic: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.
events: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past events associated with this place or organization.
seeks: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to products or services sought by the organization or person (demand).
employees: (Optional[Union[List[Union[str, Any]], str, Any]]): People working for this organization.
unnamedSourcesPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.
subOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific 'department' property.
foundingLocation: (Optional[Union[List[Union[str, Any]], str, Any]]): The place where the Organization was founded.
funder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports (sponsors) something through some kind of financial contribution.
iso6523Code: (Union[List[Union[str, Any]], str, Any]): An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly.
diversityPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.
hasMerchantReturnPolicy: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies a MerchantReturnPolicy that may be applicable.
event: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past event associated with this place, organization, or action.
duns: (Union[List[Union[str, Any]], str, Any]): The Dun & Bradstreet DUNS number for identifying an organization or business person.
alumni: (Optional[Union[List[Union[str, Any]], str, Any]]): Alumni of an organization.
ethicsPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.
leiCode: (Union[List[Union[str, Any]], str, Any]): An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.
vatID: (Union[List[Union[str, Any]], str, Any]): The Value-added Tax ID of the organization or person.
knowsLanguage: (Union[List[Union[str, Any]], str, Any]): Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).
correctionsPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.
logo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An associated logo.
hasCredential: (Optional[Union[List[Union[str, Any]], str, Any]]): A credential awarded to the Person or Organization.
address: (Union[List[Union[str, Any]], str, Any]): Physical address of the item.
brand: (Optional[Union[List[Union[str, Any]], str, Any]]): The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.
nonprofitStatus: (Optional[Union[List[Union[str, Any]], str, Any]]): nonprofitStatus indicates the legal status of a non-profit organization in its primary place of business.
contactPoint: (Optional[Union[List[Union[str, Any]], str, Any]]): A contact point for a person or organization.
hasOfferCatalog: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates an OfferCatalog listing for this Organization, Person, or Service.
members: (Optional[Union[List[Union[str, Any]], str, Any]]): A member of this organization.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
faxNumber: (Union[List[Union[str, Any]], str, Any]): The fax number.
telephone: (Union[List[Union[str, Any]], str, Any]): The telephone number.
taxID: (Union[List[Union[str, Any]], str, Any]): The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.
naics: (Union[List[Union[str, Any]], str, Any]): The North American Industry Classification System (NAICS) code for a particular organization or business person.
location: (Union[List[Union[str, Any]], str, Any]): The location of, for example, where an event is happening, where an organization is located, or where an action takes place.
numberOfEmployees: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of employees in an organization, e.g. business.
sponsor: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
geoCovers: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
longitude: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).
smokingAllowed: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.
isicV4: (Union[List[Union[str, Any]], str, Any]): The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.
globalLocationNumber: (Union[List[Union[str, Any]], str, Any]): The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.
amenityFeature: (Optional[Union[List[Union[str, Any]], str, Any]]): An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.
additionalProperty: (Optional[Union[List[Union[str, Any]], str, Any]]): A property-value pair representing an additional characteristic of the entity, e.g. a product feature or another characteristic for which there is no matching property in schema.org.Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.
slogan: (Union[List[Union[str, Any]], str, Any]): A slogan or motto associated with the item.
photos: (Optional[Union[List[Union[str, Any]], str, Any]]): Photographs of this place.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
tourBookingPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.
geoWithin: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
containsPlace: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and another that it contains.
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
hasMap: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
containedIn: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and one that contains it.
events: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past events associated with this place or organization.
geoOverlaps: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
geoEquals: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship).
maps: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
isAccessibleForFree: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the item, event, or place is accessible for free.
event: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past event associated with this place, organization, or action.
photo: (Optional[Union[List[Union[str, Any]], str, Any]]): A photograph of this place.
containedInPlace: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and one that contains it.
logo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An associated logo.
geoCrosses: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
address: (Union[List[Union[str, Any]], str, Any]): Physical address of the item.
geo: (Optional[Union[List[Union[str, Any]], str, Any]]): The geo coordinates of the place.
openingHoursSpecification: (Optional[Union[List[Union[str, Any]], str, Any]]): The opening hours of a certain place.
geoDisjoint: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: "they have no point in common. They form a set of disconnected geometries." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)
geoIntersects: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
latitude: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).
maximumAttendeeCapacity: (Optional[Union[List[Union[str, int, Any]], str, int, Any]]): The total number of individuals that may attend an event or venue.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
map: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
branchCode: (Union[List[Union[str, Any]], str, Any]): A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs.For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.
faxNumber: (Union[List[Union[str, Any]], str, Any]): The fax number.
publicAccess: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value
geoTouches: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) touch: "they have at least one boundary point in common, but no interior points." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)
geoCoveredBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
telephone: (Union[List[Union[str, Any]], str, Any]): The telephone number.
hasDriveThroughService: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.
specialOpeningHoursSpecification: (Optional[Union[List[Union[str, Any]], str, Any]]): The special opening hours of a certain place.Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]].
geoContains: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
priceRange: (Union[List[Union[str, Any]], str, Any]): The price range of the business, for example ```$$$```.
currenciesAccepted: (Union[List[Union[str, Any]], str, Any]): The currency accepted.Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217), e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types, e.g. "Ithaca HOUR".
branchOf: (Optional[Union[List[Union[str, Any]], str, Any]]): The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical) [[branch]].
paymentAccepted: (Union[List[Union[str, Any]], str, Any]): Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.
openingHours: (Union[List[Union[str, Any]], str, Any]): The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas ',' separating each day. Day or time ranges are specified using a hyphen '-'.* Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```.* Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: <code><time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays and Thursdays 4-8pm</time></code>.* If a business is open 7 days a week, then it can be specified as <code><time itemprop="openingHours" datetime="Mo-Su">Monday through Sunday, all day</time></code>.
"""
type_: str = Field(default="AnimalShelter", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
serviceArea: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The geographic area where the service is provided.",
)
founder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person who founded this organization.",
)
isicV4: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The International Standard of Industrial Classification of All Economic Activities"
"(ISIC), Revision 4 code for a particular organization, business person, or place.",
)
hasPOS: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Points-of-Sales operated by the organization or person.",
)
globalLocationNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred"
"to as International Location Number or ILN) of the respective organization, person,"
"or place. The GLN is a 13-digit number used to identify parties and physical locations.",
)
member: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A member of an Organization or a ProgramMembership. Organizations can be members of"
"organizations; ProgramMembership is typically for individuals.",
)
knowsAbout: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that"
"is known about - suggesting possible expertise but not implying it. We do not distinguish"
"skill levels here, or relate this to educational content, events, objectives or [[JobPosting]]"
"descriptions.",
)
makesOffer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to products or services offered by the organization or person.",
)
ownershipFundingInfo: Union[
List[Union[str, AnyUrl, Any]], str, AnyUrl, Any
] = Field(
default=None,
description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]),"
"a description of organizational ownership structure; funding and grants. In a news/media"
"setting, this is with particular reference to editorial independence. Note that the"
"[[funder]] is also available and can be used to make basic funder information machine-readable.",
)
founders: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person who founded this organization.",
)
legalName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The official name of the organization, e.g. the registered company name.",
)
actionableFeedbackPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement"
"about public engagement activities (for news media, the newsroom’s), including involving"
"the public - digitally or otherwise -- in coverage decisions, reporting and activities"
"after publication.",
)
areaServed: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The geographic area where a service or offered item is provided.",
)
parentOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The larger organization that this organization is a [[subOrganization]] of, if any.",
)
slogan: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A slogan or motto associated with the item.",
)
department: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A relationship between an organization and a department of that organization, also"
"described as an organization (allowing different urls, logos, opening hours). For"
"example: a store with a pharmacy, or a bakery with a cafe.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
memberOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An Organization (or ProgramMembership) to which this Person or Organization belongs.",
)
publishingPrinciples: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing"
"the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]]"
"writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity"
"policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles"
"are those of the party primarily responsible for the creation of the [[CreativeWork]].While"
"such policies are most typically expressed in natural language, sometimes related"
"information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.",
)
employee: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Someone working for this organization.",
)
award: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An award won by or for this item.",
)
email: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Email address.",
)
contactPoints: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A contact point for a person or organization.",
)
diversityStaffingReport: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]),"
"a report on staffing diversity issues. In a news context this might be for example ASNE"
"or RTDNA (US) reports, or self-reported.",
)
foundingDate: Optional[Union[List[Union[str, Any, date]], str, Any, date]] = Field(
default=None,
description="The date that this organization was founded.",
)
owns: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Products owned by the organization or person.",
)
awards: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Awards won by or for this item.",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
dissolutionDate: Optional[
Union[List[Union[str, Any, date]], str, Any, date]
] = Field(
default=None,
description="The date that this organization was dissolved.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
interactionStatistic: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication."
"The most specific child type of InteractionCounter should be used.",
)
events: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past events associated with this place or organization.",
)
seeks: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to products or services sought by the organization or person (demand).",
)
employees: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="People working for this organization.",
)
unnamedSourcesPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about"
"policy on use of unnamed sources and the decision process required.",
)
subOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A relationship between two organizations where the first includes the second, e.g.,"
"as a subsidiary. See also: the more specific 'department' property.",
)
foundingLocation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The place where the Organization was founded.",
)
funder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports (sponsors) something through some kind of financial"
"contribution.",
)
iso6523Code: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An organization identifier as defined in ISO 6523(-1). Note that many existing organization"
"identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns)"
"and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier"
"by setting the ICD part of the ISO 6523 identifier accordingly.",
)
diversityPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]."
"For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity"
"policy on both staffing and sources, typically providing staffing data.",
)
hasMerchantReturnPolicy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies a MerchantReturnPolicy that may be applicable.",
)
event: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past event associated with this place, organization, or action.",
)
duns: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Dun & Bradstreet DUNS number for identifying an organization or business person.",
)
alumni: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Alumni of an organization.",
)
ethicsPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic"
"and publishing practices, or of a [[Restaurant]], a page describing food source policies."
"In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement"
"describing the personal, organizational, and corporate standards of behavior expected"
"by the organization.",
)
leiCode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An organization identifier that uniquely identifies a legal entity as defined in ISO"
"17442.",
)
vatID: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Value-added Tax ID of the organization or person.",
)
knowsLanguage: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Of a [[Person]], and less typically of an [[Organization]], to indicate a known language."
"We do not distinguish skill levels or reading/writing/speaking/signing here. Use"
"language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).",
)
correctionsPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing"
"(in news media, the newsroom’s) disclosure and correction policy for errors.",
)
logo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An associated logo.",
)
hasCredential: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A credential awarded to the Person or Organization.",
)
address: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Physical address of the item.",
)
brand: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The brand(s) associated with a product or service, or the brand(s) maintained by an organization"
"or business person.",
)
nonprofitStatus: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="nonprofitStatus indicates the legal status of a non-profit organization in its primary"
"place of business.",
)
contactPoint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A contact point for a person or organization.",
)
hasOfferCatalog: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates an OfferCatalog listing for this Organization, Person, or Service.",
)
members: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A member of this organization.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
faxNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The fax number.",
)
telephone: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The telephone number.",
)
taxID: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in"
"Spain.",
)
naics: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The North American Industry Classification System (NAICS) code for a particular organization"
"or business person.",
)
location: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The location of, for example, where an event is happening, where an organization is located,"
"or where an action takes place.",
)
numberOfEmployees: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of employees in an organization, e.g. business.",
)
sponsor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports a thing through a pledge, promise, or financial"
"contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.",
)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
geoCovers: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a covering geometry to a covered geometry. "Every point of b is a point of (the interior'
'or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).',
)
longitude: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).",
)
smokingAllowed: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or"
"hotel room.",
)
isicV4: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The International Standard of Industrial Classification of All Economic Activities"
"(ISIC), Revision 4 code for a particular organization, business person, or place.",
)
globalLocationNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred"
"to as International Location Number or ILN) of the respective organization, person,"
"or place. The GLN is a 13-digit number used to identify parties and physical locations.",
)
amenityFeature: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic"
"property does not make a statement about whether the feature is included in an offer for"
"the main accommodation or available at extra costs.",
)
additionalProperty: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A property-value pair representing an additional characteristic of the entity, e.g."
"a product feature or another characteristic for which there is no matching property"
"in schema.org.Note: Publishers should be aware that applications designed to use specific"
"schema.org properties (e.g. https://schema.org/width, https://schema.org/color,"
"https://schema.org/gtin13, ...) will typically expect such data to be provided using"
"those properties, rather than using the generic property/value mechanism.",
)
slogan: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A slogan or motto associated with the item.",
)
photos: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Photographs of this place.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
tourBookingPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]]"
"or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.",
)
geoWithin: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined"
"in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
containsPlace: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and another that it contains.",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
hasMap: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
containedIn: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and one that contains it.",
)
events: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past events associated with this place or organization.",
)
geoOverlaps: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to another that geospatially overlaps it, i.e. they have some but not all points"
"in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
geoEquals: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
"are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM)."
'"Two geometries are topologically equal if their interiors intersect and no part of'
'the interior or boundary of one geometry intersects the exterior of the other" (a symmetric'
"relationship).",
)
maps: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
isAccessibleForFree: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the item, event, or place is accessible for free.",
)
event: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past event associated with this place, organization, or action.",
)
photo: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A photograph of this place.",
)
containedInPlace: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and one that contains it.",
)
logo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An associated logo.",
)
geoCrosses: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a geometry to another that crosses it: "a crosses b: they have some but not all interior'
"points in common, and the dimension of the intersection is less than that of at least one"
'of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).',
)
address: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Physical address of the item.",
)
geo: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The geo coordinates of the place.",
)
openingHoursSpecification: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The opening hours of a certain place.",
)
geoDisjoint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
'are topologically disjoint: "they have no point in common. They form a set of disconnected'
'geometries." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)',
)
geoIntersects: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
"have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
latitude: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).",
)
maximumAttendeeCapacity: Optional[
Union[List[Union[str, int, Any]], str, int, Any]
] = Field(
default=None,
description="The total number of individuals that may attend an event or venue.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
map: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
branchCode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description='A short textual code (also called "store code") that uniquely identifies a place of'
"business. The code is typically assigned by the parentOrganization and used in structured"
"URLs.For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047"
'the code "3047" is a branchCode for a particular branch.',
)
faxNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The fax number.",
)
publicAccess: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the [[Place]] is open to public visitors. If this property is omitted"
"there is no assumed default boolean value",
)
geoTouches: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
'touch: "they have at least one boundary point in common, but no interior points." (A'
"symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)",
)
geoCoveredBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
telephone: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The telephone number.",
)
hasDriveThroughService: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]])"
"offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]]"
"such facilities could potentially help with social distancing from other potentially-infected"
"users.",
)
specialOpeningHoursSpecification: Optional[
Union[List[Union[str, Any]], str, Any]
] = Field(
default=None,
description="The special opening hours of a certain place.Use this to explicitly override general"
"opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]].",
)
geoContains: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a containing geometry to a contained geometry. "a contains b iff no points of b lie in'
'the exterior of a, and at least one point of the interior of b lies in the interior of a".'
"As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
priceRange: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The price range of the business, for example ```$$$```.",
)
currenciesAccepted: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The currency accepted.Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217),"
'e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies)'
'for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system)'
'(LETS) and other currency types, e.g. "Ithaca HOUR".',
)
branchOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The larger organization that this local business is a branch of, if any. Not to be confused"
"with (anatomical) [[branch]].",
)
paymentAccepted: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.",
)
openingHours: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The general opening hours for a business. Opening hours can be specified as a weekly time"
"range, starting with days, then times per day. Multiple days can be listed with commas"
"',' separating each day. Day or time ranges are specified using a hyphen '-'.* Days are"
"specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```,"
"```Th```, ```Fr```, ```Sa```, ```Su```.* Times are specified using 24:00 format."
"For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example:"
'<code><time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays'
"and Thursdays 4-8pm</time></code>.* If a business is open 7 days a week, then"
"it can be specified as <code><time itemprop="openingHours" datetime="Mo-Su">Monday"
"through Sunday, all day</time></code>.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/AnimalShelter.py
| 0.884271 | 0.351923 |
AnimalShelter.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class UnincorporatedAssociationCharity(BaseModel):
"""UnincorporatedAssociationCharity: Non-profit type referring to a charitable company that is not incorporated (UK).
References:
https://schema.org/UnincorporatedAssociationCharity
Note:
Model Depth 6
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
supersededBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Relates a term (i.e. a property, class or enumeration) to one that supersedes it.
"""
type_: str = Field(
default="UnincorporatedAssociationCharity", alias="@type", const=True
)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
supersededBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/UnincorporatedAssociationCharity.py
| 0.945349 | 0.319015 |
UnincorporatedAssociationCharity.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class ViewAction(BaseModel):
"""The act of consuming static visual content.
References:
https://schema.org/ViewAction
Note:
Model Depth 4
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
endTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. E.g. John wrote a book from January to *December*. For media, including audio and video, it's the time offset of the end of a clip within a larger file.Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.
provider: (Optional[Union[List[Union[str, Any]], str, Any]]): The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller.
startTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. E.g. John wrote a book from *January* to December. For media, including audio and video, it's the time offset of the start of a clip within a larger file.Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.
result: (Optional[Union[List[Union[str, Any]], str, Any]]): The result produced in the action. E.g. John wrote *a book*.
actionStatus: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the current disposition of the Action.
agent: (Optional[Union[List[Union[str, Any]], str, Any]]): The direct performer or driver of the action (animate or inanimate). E.g. *John* wrote a book.
instrument: (Optional[Union[List[Union[str, Any]], str, Any]]): The object that helped the agent perform the action. E.g. John wrote a book with *a pen*.
object: (Optional[Union[List[Union[str, Any]], str, Any]]): The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn't). E.g. John read *a book*.
error: (Optional[Union[List[Union[str, Any]], str, Any]]): For failed actions, more information on the cause of the failure.
target: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a target EntryPoint, or url, for an Action.
location: (Union[List[Union[str, Any]], str, Any]): The location of, for example, where an event is happening, where an organization is located, or where an action takes place.
participant: (Optional[Union[List[Union[str, Any]], str, Any]]): Other co-agents that participated in the action indirectly. E.g. John wrote a book with *Steve*.
actionAccessibilityRequirement: (Optional[Union[List[Union[str, Any]], str, Any]]): A set of requirements that must be fulfilled in order to perform an Action. If more than one value is specified, fulfilling one set of requirements will allow the Action to be performed.
expectsAcceptanceOf: (Optional[Union[List[Union[str, Any]], str, Any]]): An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.
"""
type_: str = Field(default="ViewAction", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
endTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation),"
"the time that it is expected to end. For actions that span a period of time, when the action"
"was performed. E.g. John wrote a book from January to *December*. For media, including"
"audio and video, it's the time offset of the end of a clip within a larger file.Note that"
"Event uses startDate/endDate instead of startTime/endTime, even when describing"
"dates with times. This situation may be clarified in future revisions.",
)
provider: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The service provider, service operator, or service performer; the goods producer."
"Another party (a seller) may offer those services or goods on behalf of the provider."
"A provider may also serve as the seller.",
)
startTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation),"
"the time that it is expected to start. For actions that span a period of time, when the action"
"was performed. E.g. John wrote a book from *January* to December. For media, including"
"audio and video, it's the time offset of the start of a clip within a larger file.Note that"
"Event uses startDate/endDate instead of startTime/endTime, even when describing"
"dates with times. This situation may be clarified in future revisions.",
)
result: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The result produced in the action. E.g. John wrote *a book*.",
)
actionStatus: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the current disposition of the Action.",
)
agent: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The direct performer or driver of the action (animate or inanimate). E.g. *John* wrote"
"a book.",
)
instrument: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The object that helped the agent perform the action. E.g. John wrote a book with *a pen*.",
)
object: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The object upon which the action is carried out, whose state is kept intact or changed."
"Also known as the semantic roles patient, affected or undergoer (which change their"
"state) or theme (which doesn't). E.g. John read *a book*.",
)
error: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="For failed actions, more information on the cause of the failure.",
)
target: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="Indicates a target EntryPoint, or url, for an Action.",
)
location: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The location of, for example, where an event is happening, where an organization is located,"
"or where an action takes place.",
)
participant: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Other co-agents that participated in the action indirectly. E.g. John wrote a book with"
"*Steve*.",
)
actionAccessibilityRequirement: Optional[
Union[List[Union[str, Any]], str, Any]
] = Field(
default=None,
description="A set of requirements that must be fulfilled in order to perform an Action. If more than"
"one value is specified, fulfilling one set of requirements will allow the Action to be"
"performed.",
)
expectsAcceptanceOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An Offer which must be accepted before the user can perform the Action. For example, the"
"user may need to buy a movie before being able to watch it.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/ViewAction.py
| 0.933264 | 0.436262 |
ViewAction.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class ImageObjectSnapshot(BaseModel):
"""A specific and exact (byte-for-byte) version of an [[ImageObject]]. Two byte-for-byte identical files, for the purposes of this type, considered identical. If they have different embedded metadata (e.g. XMP, EXIF) the files will differ. Different external facts about the files, e.g. creator or dateCreated that aren't represented in their actual content, do not affect this notion of identity.
References:
https://schema.org/ImageObjectSnapshot
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
workTranslation: (Optional[Union[List[Union[str, Any]], str, Any]]): A work that is a translation of the content of this work. E.g. 西遊記 has an English workTranslation “Journey to the West”, a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.
educationalLevel: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The level in terms of progression through an educational or training context. Examples of educational levels include 'beginner', 'intermediate' or 'advanced', and formal sets of level indicators.
associatedMedia: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork. This property is a synonym for encoding.
exampleOfWork: (Optional[Union[List[Union[str, Any]], str, Any]]): A creative work that this work is an example/instance/realization/derivation of.
releasedEvent: (Optional[Union[List[Union[str, Any]], str, Any]]): The place and time the release was issued, expressed as a PublicationEvent.
version: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The version of the CreativeWork embodied by a specified resource.
locationCreated: (Optional[Union[List[Union[str, Any]], str, Any]]): The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.
acquireLicensePage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.
thumbnailUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A thumbnail image relevant to the Thing.
provider: (Optional[Union[List[Union[str, Any]], str, Any]]): The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller.
expires: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.
contentLocation: (Optional[Union[List[Union[str, Any]], str, Any]]): The location depicted or described in the content. For example, the location in a photograph or painting.
educationalUse: (Union[List[Union[str, Any]], str, Any]): The purpose of a work in the context of education; for example, 'assignment', 'group work'.
copyrightHolder: (Optional[Union[List[Union[str, Any]], str, Any]]): The party holding the legal copyright to the CreativeWork.
accessibilityControl: (Union[List[Union[str, Any]], str, Any]): Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).
maintainer: (Optional[Union[List[Union[str, Any]], str, Any]]): A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.
educationalAlignment: (Optional[Union[List[Union[str, Any]], str, Any]]): An alignment to an established educational framework.This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.
spatial: (Optional[Union[List[Union[str, Any]], str, Any]]): The "spatial" property can be used in cases when more specific properties(e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.
publisher: (Optional[Union[List[Union[str, Any]], str, Any]]): The publisher of the creative work.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
assesses: (Union[List[Union[str, Any]], str, Any]): The item being described is intended to assess the competency or learning outcome defined by the referenced term.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
isBasedOn: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A resource from which this work is derived or from which it is a modification or adaption.
mentions: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.
publishingPrinciples: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]].While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.
contributor: (Optional[Union[List[Union[str, Any]], str, Any]]): A secondary contributor to the CreativeWork or Event.
license: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A license document that applies to this content, typically indicated by URL.
citation: (Union[List[Union[str, Any]], str, Any]): A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.
accessibilitySummary: (Union[List[Union[str, Any]], str, Any]): A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."
award: (Union[List[Union[str, Any]], str, Any]): An award won by or for this item.
commentCount: (Optional[Union[List[Union[str, int, Any]], str, int, Any]]): The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.
temporalCoverage: (Union[List[Union[datetime, str, Any, AnyUrl]], datetime, str, Any, AnyUrl]): The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content, e.g. ScholarlyArticle, Book, TVSeries or TVEpisode, may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945".Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.
dateCreated: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date on which the CreativeWork was created or the item was added to a DataFeed.
discussionUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A link to the page containing the comments of the CreativeWork.
copyrightNotice: (Union[List[Union[str, Any]], str, Any]): Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.
learningResourceType: (Union[List[Union[str, Any]], str, Any]): The predominant type or kind characterizing the learning resource. For example, 'presentation', 'handout'.
awards: (Union[List[Union[str, Any]], str, Any]): Awards won by or for this item.
accessModeSufficient: (Optional[Union[List[Union[str, Any]], str, Any]]): A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
conditionsOfAccess: (Union[List[Union[str, Any]], str, Any]): Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language.For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".
interactivityType: (Union[List[Union[str, Any]], str, Any]): The predominant mode of learning supported by the learning resource. Acceptable values are 'active', 'expositive', or 'mixed'.
abstract: (Union[List[Union[str, Any]], str, Any]): An abstract is a short description that summarizes a [[CreativeWork]].
fileFormat: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content, e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, 'encoding' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.
interpretedAsClaim: (Optional[Union[List[Union[str, Any]], str, Any]]): Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].
text: (Union[List[Union[str, Any]], str, Any]): The textual content of this CreativeWork.
archivedAt: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.
alternativeHeadline: (Union[List[Union[str, Any]], str, Any]): A secondary title of the CreativeWork.
creditText: (Union[List[Union[str, Any]], str, Any]): Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
interactionStatistic: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.
workExample: (Optional[Union[List[Union[str, Any]], str, Any]]): Example/instance/realization/derivation of the concept of this creative work. E.g. the paperback edition, first edition, or e-book.
about: (Optional[Union[List[Union[str, Any]], str, Any]]): The subject matter of the content.
encodings: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork.
funder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports (sponsors) something through some kind of financial contribution.
video: (Optional[Union[List[Union[str, Any]], str, Any]]): An embedded video object.
isPartOf: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.
pattern: (Union[List[Union[str, Any]], str, Any]): A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'. Values are typically expressed as text, although links to controlled value schemes are also supported.
editor: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the Person who edited the CreativeWork.
dateModified: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date on which the CreativeWork was most recently modified or when the item's entry was modified within a DataFeed.
translationOfWork: (Optional[Union[List[Union[str, Any]], str, Any]]): The work that this work has been translated from. E.g. 物种起源 is a translationOf “On the Origin of Species”.
creativeWorkStatus: (Union[List[Union[str, Any]], str, Any]): The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.
isBasedOnUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.
isFamilyFriendly: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether this content is family friendly.
isAccessibleForFree: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the item, event, or place is accessible for free.
author: (Optional[Union[List[Union[str, Any]], str, Any]]): The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.
contentReferenceTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.
correction: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.
sdDatePublished: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]
comment: (Optional[Union[List[Union[str, Any]], str, Any]]): Comments, typically from users.
countryOfOrigin: (Optional[Union[List[Union[str, Any]], str, Any]]): The country of origin of something, including products as well as creative works such as movie and TV content.In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable.In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.
timeRequired: (Optional[Union[List[Union[str, Any]], str, Any]]): Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.
typicalAgeRange: (Union[List[Union[str, Any]], str, Any]): The typical expected age range, e.g. '7-9', '11-'.
genre: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Genre of the creative work, broadcast channel or group.
producer: (Optional[Union[List[Union[str, Any]], str, Any]]): The person or organization who produced the work (e.g. music album, movie, TV/radio series etc.).
schemaVersion: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.
audience: (Optional[Union[List[Union[str, Any]], str, Any]]): An intended audience, i.e. a group for whom something was created.
encoding: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.
publisherImprint: (Optional[Union[List[Union[str, Any]], str, Any]]): The publishing division which published the comic.
accessibilityAPI: (Union[List[Union[str, Any]], str, Any]): Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).
sdPublisher: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The[[sdPublisher]] property helps make such practices more explicit.
audio: (Optional[Union[List[Union[str, Any]], str, Any]]): An embedded audio object.
accessibilityFeature: (Union[List[Union[str, Any]], str, Any]): Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).
spatialCoverage: (Optional[Union[List[Union[str, Any]], str, Any]]): The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.
accessMode: (Union[List[Union[str, Any]], str, Any]): The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).
editEIDR: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television.For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J" has several edits, e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3".Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description.
usageInfo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information, e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options.This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.
position: (Union[List[Union[str, int, Any]], str, int, Any]): The position of an item in a series or sequence of items.
encodingFormat: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)), e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information.Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.
copyrightYear: (Optional[Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]]): The year during which the claimed copyright for the CreativeWork was first asserted.
mainEntity: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the primary entity described in some page or other CreativeWork.
creator: (Optional[Union[List[Union[str, Any]], str, Any]]): The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.
teaches: (Union[List[Union[str, Any]], str, Any]): The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.
temporal: (Union[List[Union[datetime, str, Any]], datetime, str, Any]): The "temporal" property can be used in cases where more specific properties(e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.
size: (Union[List[Union[str, Any]], str, Any]): A standardized size of a product or creative work, specified either through a simple textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable.
translator: (Optional[Union[List[Union[str, Any]], str, Any]]): Organization or person who adapts a creative work to different languages, regional differences and technical requirements of a target market, or that translates during some event.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
accountablePerson: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the Person that is legally accountable for the CreativeWork.
accessibilityHazard: (Union[List[Union[str, Any]], str, Any]): A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).
contentRating: (Union[List[Union[str, Any]], str, Any]): Official rating of a piece of content—for example, 'MPAA PG-13'.
recordedAt: (Optional[Union[List[Union[str, Any]], str, Any]]): The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.
publication: (Optional[Union[List[Union[str, Any]], str, Any]]): A publication event associated with the item.
sdLicense: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A license document that applies to this structured data, typically indicated by URL.
headline: (Union[List[Union[str, Any]], str, Any]): Headline of the article.
materialExtent: (Union[List[Union[str, Any]], str, Any]): The quantity of the materials being described or an expression of the physical space they occupy.
inLanguage: (Union[List[Union[str, Any]], str, Any]): The language of the content or performance or used in an action. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[availableLanguage]].
material: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): A material that something is made from, e.g. leather, wool, cotton, paper.
datePublished: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): Date of first broadcast/publication.
offers: (Optional[Union[List[Union[str, Any]], str, Any]]): An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]] to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can also be used to describe a [[Demand]]. While this property is listed as expected on a number of common types, it can be used in others. In that case, using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.
hasPart: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).
sourceOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): The Organization on whose behalf the creator was working.
sponsor: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.
character: (Optional[Union[List[Union[str, Any]], str, Any]]): Fictional person connected with a creative work.
embedUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL pointing to a player for a specific video. In general, this is the information in the ```src``` element of an ```embed``` tag and should not be the same as the content of the ```loc``` tag.
bitrate: (Union[List[Union[str, Any]], str, Any]): The bitrate of the media object.
width: (Optional[Union[List[Union[str, Any]], str, Any]]): The width of the item.
sha256: (Union[List[Union[str, Any]], str, Any]): The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of the item. For example, a zero-length input has value 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
endTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. E.g. John wrote a book from January to *December*. For media, including audio and video, it's the time offset of the end of a clip within a larger file.Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.
startTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. E.g. John wrote a book from *January* to December. For media, including audio and video, it's the time offset of the start of a clip within a larger file.Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.
contentSize: (Union[List[Union[str, Any]], str, Any]): File size in (mega/kilo)bytes.
height: (Optional[Union[List[Union[str, Any]], str, Any]]): The height of the item.
playerType: (Union[List[Union[str, Any]], str, Any]): Player type required—for example, Flash or Silverlight.
associatedArticle: (Optional[Union[List[Union[str, Any]], str, Any]]): A NewsArticle associated with the Media Object.
interpretedAsClaim: (Optional[Union[List[Union[str, Any]], str, Any]]): Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].
duration: (Optional[Union[List[Union[str, Any]], str, Any]]): The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).
requiresSubscription: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates if use of the media require a subscription (either paid or free). Allowed values are ```true``` or ```false``` (note that an earlier version had 'yes', 'no').
regionsAllowed: (Optional[Union[List[Union[str, Any]], str, Any]]): The regions where the media is allowed. If not specified, then it's assumed to be allowed everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).
contentUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Actual bytes of the media object, for example the image file or video file.
productionCompany: (Optional[Union[List[Union[str, Any]], str, Any]]): The production company or studio responsible for the item, e.g. series, video game, episode etc.
encodesCreativeWork: (Optional[Union[List[Union[str, Any]], str, Any]]): The CreativeWork encoded by this media object.
uploadDate: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): Date when this media object was uploaded to this site.
ineligibleRegion: (Union[List[Union[str, Any]], str, Any]): The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for the geo-political region(s) for which the offer or delivery charge specification is not valid, e.g. a region where the transaction is not allowed.See also [[eligibleRegion]].
encodingFormat: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)), e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information.Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.
caption: (Union[List[Union[str, Any]], str, Any]): The caption for this object. For downloadable machine formats (closed caption, subtitles etc.) use MediaObject and indicate the [[encodingFormat]].
thumbnail: (Optional[Union[List[Union[str, Any]], str, Any]]): Thumbnail image for an image or video.
exifData: (Union[List[Union[str, Any]], str, Any]): exif data for this object.
embeddedTextCaption: (Union[List[Union[str, Any]], str, Any]): Represents textual captioning from a [[MediaObject]], e.g. text of a 'meme'.
representativeOfPage: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether this image is representative of the content of the page.
"""
type_: str = Field(default="ImageObjectSnapshot", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
workTranslation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A work that is a translation of the content of this work. E.g. 西遊記 has an English workTranslation"
"“Journey to the West”, a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese"
"translation Tây du ký bình khảo.",
)
educationalLevel: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The level in terms of progression through an educational or training context. Examples"
"of educational levels include 'beginner', 'intermediate' or 'advanced', and formal"
"sets of level indicators.",
)
associatedMedia: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork. This property is a synonym for encoding.",
)
exampleOfWork: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A creative work that this work is an example/instance/realization/derivation of.",
)
releasedEvent: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The place and time the release was issued, expressed as a PublicationEvent.",
)
version: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The version of the CreativeWork embodied by a specified resource.",
)
locationCreated: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The location where the CreativeWork was created, which may not be the same as the location"
"depicted in the CreativeWork.",
)
acquireLicensePage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page documenting how licenses can be purchased or otherwise acquired, for"
"the current item.",
)
thumbnailUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A thumbnail image relevant to the Thing.",
)
provider: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The service provider, service operator, or service performer; the goods producer."
"Another party (a seller) may offer those services or goods on behalf of the provider."
"A provider may also serve as the seller.",
)
expires: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="Date the content expires and is no longer useful or available. For example a [[VideoObject]]"
"or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]]"
"fact check whose publisher wants to indicate that it may no longer be relevant (or helpful"
"to highlight) after some date.",
)
contentLocation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The location depicted or described in the content. For example, the location in a photograph"
"or painting.",
)
educationalUse: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The purpose of a work in the context of education; for example, 'assignment', 'group"
"work'.",
)
copyrightHolder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The party holding the legal copyright to the CreativeWork.",
)
accessibilityControl: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Identifies input methods that are sufficient to fully control the described resource."
"Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).",
)
maintainer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other"
"[[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions"
"to, and/or publication of, some (typically complex) artifact. It is common for distributions"
'of software and data to be based on "upstream" sources. When [[maintainer]] is applied'
"to a specific version of something e.g. a particular version or packaging of a [[Dataset]],"
"it is always possible that the upstream source has a different maintainer. The [[isBasedOn]]"
"property can be used to indicate such relationships between datasets to make the different"
"maintenance roles clear. Similarly in the case of software, a package may have dedicated"
"maintainers working on integration into software distributions such as Ubuntu, as"
"well as upstream maintainers of the underlying work.",
)
educationalAlignment: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An alignment to an established educational framework.This property should not be used"
"where the nature of the alignment can be described using a simple property, for example"
"to express that a resource [[teaches]] or [[assesses]] a competency.",
)
spatial: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description='The "spatial" property can be used in cases when more specific properties(e.g. [[locationCreated]],'
"[[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.",
)
publisher: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The publisher of the creative work.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
assesses: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The item being described is intended to assess the competency or learning outcome defined"
"by the referenced term.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
isBasedOn: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A resource from which this work is derived or from which it is a modification or adaption.",
)
mentions: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates that the CreativeWork contains a reference to, but is not necessarily about"
"a concept.",
)
publishingPrinciples: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing"
"the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]]"
"writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity"
"policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles"
"are those of the party primarily responsible for the creation of the [[CreativeWork]].While"
"such policies are most typically expressed in natural language, sometimes related"
"information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.",
)
contributor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A secondary contributor to the CreativeWork or Event.",
)
license: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A license document that applies to this content, typically indicated by URL.",
)
citation: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A citation or reference to another creative work, such as another publication, web page,"
"scholarly article, etc.",
)
accessibilitySummary: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A human-readable summary of specific accessibility features or deficiencies, consistent"
'with the other accessibility metadata but expressing subtleties such as "short descriptions'
'are present but long descriptions will be needed for non-visual users" or "short descriptions'
'are present and no long descriptions are needed."',
)
award: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An award won by or for this item.",
)
commentCount: Optional[Union[List[Union[str, int, Any]], str, int, Any]] = Field(
default=None,
description="The number of comments this CreativeWork (e.g. Article, Question or Answer) has received."
"This is most applicable to works published in Web sites with commenting system; additional"
"comments may exist elsewhere.",
)
temporalCoverage: Union[
List[Union[datetime, str, Any, AnyUrl]], datetime, str, Any, AnyUrl
] = Field(
default=None,
description="The temporalCoverage of a CreativeWork indicates the period that the content applies"
"to, i.e. that it describes, either as a DateTime or as a textual string indicating a time"
"period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals)."
"In the case of a Dataset it will typically indicate the relevant time period in a precise"
'notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012").'
"Other forms of content, e.g. ScholarlyArticle, Book, TVSeries or TVEpisode, may indicate"
"their temporalCoverage in broader terms - textually or via well-known URL. Written"
"works such as books may sometimes have precise temporal coverage too, e.g. a work set"
'in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945".Open-ended'
'date ranges can be written with ".." in place of the end date. For example, "2015-11/.."'
"indicates a range beginning in November 2015 and with no specified final date. This is"
"tentative and might be updated in future when ISO 8601 is officially updated.",
)
dateCreated: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date on which the CreativeWork was created or the item was added to a DataFeed.",
)
discussionUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A link to the page containing the comments of the CreativeWork.",
)
copyrightNotice: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Text of a notice appropriate for describing the copyright aspects of this Creative Work,"
"ideally indicating the owner of the copyright for the Work.",
)
learningResourceType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The predominant type or kind characterizing the learning resource. For example, 'presentation',"
"'handout'.",
)
awards: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Awards won by or for this item.",
)
accessModeSufficient: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A list of single or combined accessModes that are sufficient to understand all the intellectual"
"content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
conditionsOfAccess: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Conditions that affect the availability of, or method(s) of access to, an item. Typically"
"used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]."
"This property is not suitable for use as a general Web access control mechanism. It is"
'expressed only in natural language.For example "Available by appointment from the'
'Reading Room" or "Accessible only from logged-in accounts ".',
)
interactivityType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The predominant mode of learning supported by the learning resource. Acceptable values"
"are 'active', 'expositive', or 'mixed'.",
)
abstract: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An abstract is a short description that summarizes a [[CreativeWork]].",
)
fileFormat: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml))"
"of the content, e.g. application/zip of a SoftwareApplication binary. In cases where"
"a CreativeWork has several media type representations, 'encoding' can be used to indicate"
"each MediaObject alongside particular fileFormat information. Unregistered or niche"
"file formats can be indicated instead via the most appropriate URL, e.g. defining Web"
"page or a Wikipedia entry.",
)
interpretedAsClaim: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Used to indicate a specific claim contained, implied, translated or refined from the"
"content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can"
"be indicated using [[claimInterpreter]].",
)
text: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The textual content of this CreativeWork.",
)
archivedAt: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case"
"of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible,"
"but be archived by archival, journalistic, activist, or law enforcement organizations."
"In such cases, the referenced page may not directly publish the content.",
)
alternativeHeadline: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A secondary title of the CreativeWork.",
)
creditText: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Text that can be used to credit person(s) and/or organization(s) associated with a published"
"Creative Work.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
interactionStatistic: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication."
"The most specific child type of InteractionCounter should be used.",
)
workExample: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Example/instance/realization/derivation of the concept of this creative work. E.g."
"the paperback edition, first edition, or e-book.",
)
about: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The subject matter of the content.",
)
encodings: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork.",
)
funder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports (sponsors) something through some kind of financial"
"contribution.",
)
video: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An embedded video object.",
)
isPartOf: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is"
"part of.",
)
pattern: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'."
"Values are typically expressed as text, although links to controlled value schemes"
"are also supported.",
)
editor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the Person who edited the CreativeWork.",
)
dateModified: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date on which the CreativeWork was most recently modified or when the item's entry"
"was modified within a DataFeed.",
)
translationOfWork: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The work that this work has been translated from. E.g. 物种起源 is a translationOf “On the"
"Origin of Species”.",
)
creativeWorkStatus: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The status of a creative work in terms of its stage in a lifecycle. Example terms include"
"Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for"
"the stages of their publication lifecycle.",
)
isBasedOnUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A resource that was used in the creation of this resource. This term can be repeated for"
"multiple sources. For example, http://example.com/great-multiplication-intro.html.",
)
isFamilyFriendly: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether this content is family friendly.",
)
isAccessibleForFree: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the item, event, or place is accessible for free.",
)
author: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The author of this content or rating. Please note that author is special in that HTML 5"
"provides a special mechanism for indicating authorship via the rel tag. That is equivalent"
"to this and may be used interchangeably.",
)
contentReferenceTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The specific time described by a creative work, for works (e.g. articles, video objects"
"etc.) that emphasise a particular moment within an Event.",
)
correction: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]],"
"textually or in another document.",
)
sdDatePublished: Optional[
Union[List[Union[str, Any, date]], str, Any, date]
] = Field(
default=None,
description="Indicates the date on which the current structured data was generated / published. Typically"
"used alongside [[sdPublisher]]",
)
comment: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Comments, typically from users.",
)
countryOfOrigin: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The country of origin of something, including products as well as creative works such"
"as movie and TV content.In the case of TV and movie, this would be the country of the principle"
"offices of the production company or individual responsible for the movie. For other"
"kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties"
"such as [[contentLocation]] and [[locationCreated]] may be more applicable.In the"
"case of products, the country of origin of the product. The exact interpretation of this"
"may vary by context and product type, and cannot be fully enumerated here.",
)
timeRequired: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Approximate or typical time it takes to work with or through this learning resource for"
"the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.",
)
typicalAgeRange: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The typical expected age range, e.g. '7-9', '11-'.",
)
genre: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Genre of the creative work, broadcast channel or group.",
)
producer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The person or organization who produced the work (e.g. music album, movie, TV/radio"
"series etc.).",
)
schemaVersion: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Indicates (by URL or string) a particular version of a schema used in some CreativeWork."
"This property was created primarily to indicate the use of a specific schema.org release,"
"e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```."
"There may be situations in which other schemas might usefully be referenced this way,"
"e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/```"
"but this has not been carefully explored in the community.",
)
audience: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An intended audience, i.e. a group for whom something was created.",
)
encoding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.",
)
publisherImprint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The publishing division which published the comic.",
)
accessibilityAPI: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Indicates that the resource is compatible with the referenced accessibility API. Values"
"should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).",
)
sdPublisher: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the party responsible for generating and publishing the current structured"
"data markup, typically in cases where the structured data is derived automatically"
"from existing published content but published on a different site. For example, student"
"projects and open data initiatives often re-publish existing content with more explicitly"
"structured metadata. The[[sdPublisher]] property helps make such practices more"
"explicit.",
)
audio: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An embedded audio object.",
)
accessibilityFeature: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Content features of the resource, such as accessible media, alternatives and supported"
"enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).",
)
spatialCoverage: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of"
"the content. It is a subproperty of contentLocation intended primarily for more technical"
"and detailed materials. For example with a Dataset, it indicates areas that the dataset"
"describes: a dataset of New York weather would have spatialCoverage which was the place:"
"the state of New York.",
)
accessMode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The human sensory perceptual system or cognitive faculty through which a person may"
"process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).",
)
editEIDR: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]]"
"representing a specific edit / edition for a work of film or television.For example,"
'the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J"'
'has several edits, e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3".Since'
"schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their"
"multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description),"
"or alongside [[editEIDR]] for a more edit-specific description.",
)
usageInfo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]."
"This property is applicable both to works that are freely available and to those that"
"require payment or other transactions. It can reference additional information, e.g."
"community expectations on preferred linking and citation conventions, as well as purchasing"
"details. For something that can be commercially licensed, usageInfo can provide detailed,"
"resource-specific information about licensing options.This property can be used"
"alongside the license property which indicates license(s) applicable to some piece"
"of content. The usageInfo property can provide information about other licensing options,"
"e.g. acquiring commercial usage rights for an image that is also available under non-commercial"
"creative commons licenses.",
)
position: Union[List[Union[str, int, Any]], str, int, Any] = Field(
default=None,
description="The position of an item in a series or sequence of items.",
)
encodingFormat: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)"
"and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)),"
"e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In"
"cases where a [[CreativeWork]] has several media type representations, [[encoding]]"
"can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]]"
"information.Unregistered or niche encoding and file formats can be indicated instead"
"via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.",
)
copyrightYear: Optional[
Union[
List[Union[str, Any, StrictInt, StrictFloat]],
str,
Any,
StrictInt,
StrictFloat,
]
] = Field(
default=None,
description="The year during which the claimed copyright for the CreativeWork was first asserted.",
)
mainEntity: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the primary entity described in some page or other CreativeWork.",
)
creator: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The creator/author of this CreativeWork. This is the same as the Author property for"
"CreativeWork.",
)
teaches: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The item being described is intended to help a person learn the competency or learning"
"outcome defined by the referenced term.",
)
temporal: Union[List[Union[datetime, str, Any]], datetime, str, Any] = Field(
default=None,
description='The "temporal" property can be used in cases where more specific properties(e.g.'
"[[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]])"
"are not known to be appropriate.",
)
size: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A standardized size of a product or creative work, specified either through a simple"
"textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode,"
"or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]],"
"[[height]], [[depth]] and [[weight]] properties may be more applicable.",
)
translator: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Organization or person who adapts a creative work to different languages, regional"
"differences and technical requirements of a target market, or that translates during"
"some event.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
accountablePerson: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the Person that is legally accountable for the CreativeWork.",
)
accessibilityHazard: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A characteristic of the described resource that is physiologically dangerous to some"
"users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).",
)
contentRating: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Official rating of a piece of content—for example, 'MPAA PG-13'.",
)
recordedAt: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The Event where the CreativeWork was recorded. The CreativeWork may capture all or part"
"of the event.",
)
publication: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A publication event associated with the item.",
)
sdLicense: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A license document that applies to this structured data, typically indicated by URL.",
)
headline: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Headline of the article.",
)
materialExtent: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The quantity of the materials being described or an expression of the physical space"
"they occupy.",
)
inLanguage: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The language of the content or performance or used in an action. Please use one of the language"
"codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also"
"[[availableLanguage]].",
)
material: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="A material that something is made from, e.g. leather, wool, cotton, paper.",
)
datePublished: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="Date of first broadcast/publication.",
)
offers: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An offer to provide this item—for example, an offer to sell a product, rent the"
"DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]"
"to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can"
"also be used to describe a [[Demand]]. While this property is listed as expected on a number"
"of common types, it can be used in others. In that case, using a second type, such as Product"
"or a subtype of Product, can clarify the nature of the offer.",
)
hasPart: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some"
"sense).",
)
sourceOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The Organization on whose behalf the creator was working.",
)
sponsor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports a thing through a pledge, promise, or financial"
"contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.",
)
character: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Fictional person connected with a creative work.",
)
embedUrl: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL pointing to a player for a specific video. In general, this is the information in"
"the ```src``` element of an ```embed``` tag and should not be the same as the content of"
"the ```loc``` tag.",
)
bitrate: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The bitrate of the media object.",
)
width: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The width of the item.",
)
sha256: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of"
"the item. For example, a zero-length input has value 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'",
)
endTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation),"
"the time that it is expected to end. For actions that span a period of time, when the action"
"was performed. E.g. John wrote a book from January to *December*. For media, including"
"audio and video, it's the time offset of the end of a clip within a larger file.Note that"
"Event uses startDate/endDate instead of startTime/endTime, even when describing"
"dates with times. This situation may be clarified in future revisions.",
)
startTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation),"
"the time that it is expected to start. For actions that span a period of time, when the action"
"was performed. E.g. John wrote a book from *January* to December. For media, including"
"audio and video, it's the time offset of the start of a clip within a larger file.Note that"
"Event uses startDate/endDate instead of startTime/endTime, even when describing"
"dates with times. This situation may be clarified in future revisions.",
)
contentSize: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="File size in (mega/kilo)bytes.",
)
height: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The height of the item.",
)
playerType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Player type required—for example, Flash or Silverlight.",
)
associatedArticle: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A NewsArticle associated with the Media Object.",
)
interpretedAsClaim: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Used to indicate a specific claim contained, implied, translated or refined from the"
"content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can"
"be indicated using [[claimInterpreter]].",
)
duration: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).",
)
requiresSubscription: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates if use of the media require a subscription (either paid or free). Allowed values"
"are ```true``` or ```false``` (note that an earlier version had 'yes', 'no').",
)
regionsAllowed: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The regions where the media is allowed. If not specified, then it's assumed to be allowed"
"everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).",
)
contentUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Actual bytes of the media object, for example the image file or video file.",
)
productionCompany: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The production company or studio responsible for the item, e.g. series, video game,"
"episode etc.",
)
encodesCreativeWork: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The CreativeWork encoded by this media object.",
)
uploadDate: Optional[Union[List[Union[str, Any, date]], str, Any, date]] = Field(
default=None,
description="Date when this media object was uploaded to this site.",
)
ineligibleRegion: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for"
"the geo-political region(s) for which the offer or delivery charge specification is"
"not valid, e.g. a region where the transaction is not allowed.See also [[eligibleRegion]].",
)
encodingFormat: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)"
"and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)),"
"e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In"
"cases where a [[CreativeWork]] has several media type representations, [[encoding]]"
"can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]]"
"information.Unregistered or niche encoding and file formats can be indicated instead"
"via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.",
)
caption: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The caption for this object. For downloadable machine formats (closed caption, subtitles"
"etc.) use MediaObject and indicate the [[encodingFormat]].",
)
thumbnail: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Thumbnail image for an image or video.",
)
exifData: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="exif data for this object.",
)
embeddedTextCaption: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Represents textual captioning from a [[MediaObject]], e.g. text of a 'meme'.",
)
representativeOfPage: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether this image is representative of the content of the page.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/ImageObjectSnapshot.py
| 0.928587 | 0.355495 |
ImageObjectSnapshot.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class LoseAction(BaseModel):
"""The act of being defeated in a competitive activity.
References:
https://schema.org/LoseAction
Note:
Model Depth 4
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
endTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. E.g. John wrote a book from January to *December*. For media, including audio and video, it's the time offset of the end of a clip within a larger file.Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.
provider: (Optional[Union[List[Union[str, Any]], str, Any]]): The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller.
startTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. E.g. John wrote a book from *January* to December. For media, including audio and video, it's the time offset of the start of a clip within a larger file.Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.
result: (Optional[Union[List[Union[str, Any]], str, Any]]): The result produced in the action. E.g. John wrote *a book*.
actionStatus: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the current disposition of the Action.
agent: (Optional[Union[List[Union[str, Any]], str, Any]]): The direct performer or driver of the action (animate or inanimate). E.g. *John* wrote a book.
instrument: (Optional[Union[List[Union[str, Any]], str, Any]]): The object that helped the agent perform the action. E.g. John wrote a book with *a pen*.
object: (Optional[Union[List[Union[str, Any]], str, Any]]): The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn't). E.g. John read *a book*.
error: (Optional[Union[List[Union[str, Any]], str, Any]]): For failed actions, more information on the cause of the failure.
target: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a target EntryPoint, or url, for an Action.
location: (Union[List[Union[str, Any]], str, Any]): The location of, for example, where an event is happening, where an organization is located, or where an action takes place.
participant: (Optional[Union[List[Union[str, Any]], str, Any]]): Other co-agents that participated in the action indirectly. E.g. John wrote a book with *Steve*.
winner: (Optional[Union[List[Union[str, Any]], str, Any]]): A sub property of participant. The winner of the action.
"""
type_: str = Field(default="LoseAction", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
endTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation),"
"the time that it is expected to end. For actions that span a period of time, when the action"
"was performed. E.g. John wrote a book from January to *December*. For media, including"
"audio and video, it's the time offset of the end of a clip within a larger file.Note that"
"Event uses startDate/endDate instead of startTime/endTime, even when describing"
"dates with times. This situation may be clarified in future revisions.",
)
provider: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The service provider, service operator, or service performer; the goods producer."
"Another party (a seller) may offer those services or goods on behalf of the provider."
"A provider may also serve as the seller.",
)
startTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation),"
"the time that it is expected to start. For actions that span a period of time, when the action"
"was performed. E.g. John wrote a book from *January* to December. For media, including"
"audio and video, it's the time offset of the start of a clip within a larger file.Note that"
"Event uses startDate/endDate instead of startTime/endTime, even when describing"
"dates with times. This situation may be clarified in future revisions.",
)
result: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The result produced in the action. E.g. John wrote *a book*.",
)
actionStatus: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the current disposition of the Action.",
)
agent: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The direct performer or driver of the action (animate or inanimate). E.g. *John* wrote"
"a book.",
)
instrument: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The object that helped the agent perform the action. E.g. John wrote a book with *a pen*.",
)
object: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The object upon which the action is carried out, whose state is kept intact or changed."
"Also known as the semantic roles patient, affected or undergoer (which change their"
"state) or theme (which doesn't). E.g. John read *a book*.",
)
error: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="For failed actions, more information on the cause of the failure.",
)
target: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="Indicates a target EntryPoint, or url, for an Action.",
)
location: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The location of, for example, where an event is happening, where an organization is located,"
"or where an action takes place.",
)
participant: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Other co-agents that participated in the action indirectly. E.g. John wrote a book with"
"*Steve*.",
)
winner: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A sub property of participant. The winner of the action.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/LoseAction.py
| 0.94439 | 0.436202 |
LoseAction.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class ArtGallery(BaseModel):
"""An art gallery.
References:
https://schema.org/ArtGallery
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
serviceArea: (Optional[Union[List[Union[str, Any]], str, Any]]): The geographic area where the service is provided.
founder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person who founded this organization.
isicV4: (Union[List[Union[str, Any]], str, Any]): The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.
hasPOS: (Optional[Union[List[Union[str, Any]], str, Any]]): Points-of-Sales operated by the organization or person.
globalLocationNumber: (Union[List[Union[str, Any]], str, Any]): The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.
member: (Optional[Union[List[Union[str, Any]], str, Any]]): A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.
knowsAbout: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.
makesOffer: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to products or services offered by the organization or person.
ownershipFundingInfo: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.
founders: (Optional[Union[List[Union[str, Any]], str, Any]]): A person who founded this organization.
legalName: (Union[List[Union[str, Any]], str, Any]): The official name of the organization, e.g. the registered company name.
actionableFeedbackPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.
areaServed: (Union[List[Union[str, Any]], str, Any]): The geographic area where a service or offered item is provided.
parentOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): The larger organization that this organization is a [[subOrganization]] of, if any.
slogan: (Union[List[Union[str, Any]], str, Any]): A slogan or motto associated with the item.
department: (Optional[Union[List[Union[str, Any]], str, Any]]): A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
memberOf: (Optional[Union[List[Union[str, Any]], str, Any]]): An Organization (or ProgramMembership) to which this Person or Organization belongs.
publishingPrinciples: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]].While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.
employee: (Optional[Union[List[Union[str, Any]], str, Any]]): Someone working for this organization.
award: (Union[List[Union[str, Any]], str, Any]): An award won by or for this item.
email: (Union[List[Union[str, Any]], str, Any]): Email address.
contactPoints: (Optional[Union[List[Union[str, Any]], str, Any]]): A contact point for a person or organization.
diversityStaffingReport: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.
foundingDate: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): The date that this organization was founded.
owns: (Optional[Union[List[Union[str, Any]], str, Any]]): Products owned by the organization or person.
awards: (Union[List[Union[str, Any]], str, Any]): Awards won by or for this item.
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
dissolutionDate: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): The date that this organization was dissolved.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
interactionStatistic: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.
events: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past events associated with this place or organization.
seeks: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to products or services sought by the organization or person (demand).
employees: (Optional[Union[List[Union[str, Any]], str, Any]]): People working for this organization.
unnamedSourcesPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.
subOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific 'department' property.
foundingLocation: (Optional[Union[List[Union[str, Any]], str, Any]]): The place where the Organization was founded.
funder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports (sponsors) something through some kind of financial contribution.
iso6523Code: (Union[List[Union[str, Any]], str, Any]): An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly.
diversityPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.
hasMerchantReturnPolicy: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies a MerchantReturnPolicy that may be applicable.
event: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past event associated with this place, organization, or action.
duns: (Union[List[Union[str, Any]], str, Any]): The Dun & Bradstreet DUNS number for identifying an organization or business person.
alumni: (Optional[Union[List[Union[str, Any]], str, Any]]): Alumni of an organization.
ethicsPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.
leiCode: (Union[List[Union[str, Any]], str, Any]): An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.
vatID: (Union[List[Union[str, Any]], str, Any]): The Value-added Tax ID of the organization or person.
knowsLanguage: (Union[List[Union[str, Any]], str, Any]): Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).
correctionsPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.
logo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An associated logo.
hasCredential: (Optional[Union[List[Union[str, Any]], str, Any]]): A credential awarded to the Person or Organization.
address: (Union[List[Union[str, Any]], str, Any]): Physical address of the item.
brand: (Optional[Union[List[Union[str, Any]], str, Any]]): The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.
nonprofitStatus: (Optional[Union[List[Union[str, Any]], str, Any]]): nonprofitStatus indicates the legal status of a non-profit organization in its primary place of business.
contactPoint: (Optional[Union[List[Union[str, Any]], str, Any]]): A contact point for a person or organization.
hasOfferCatalog: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates an OfferCatalog listing for this Organization, Person, or Service.
members: (Optional[Union[List[Union[str, Any]], str, Any]]): A member of this organization.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
faxNumber: (Union[List[Union[str, Any]], str, Any]): The fax number.
telephone: (Union[List[Union[str, Any]], str, Any]): The telephone number.
taxID: (Union[List[Union[str, Any]], str, Any]): The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.
naics: (Union[List[Union[str, Any]], str, Any]): The North American Industry Classification System (NAICS) code for a particular organization or business person.
location: (Union[List[Union[str, Any]], str, Any]): The location of, for example, where an event is happening, where an organization is located, or where an action takes place.
numberOfEmployees: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of employees in an organization, e.g. business.
sponsor: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
geoCovers: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
longitude: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).
smokingAllowed: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.
isicV4: (Union[List[Union[str, Any]], str, Any]): The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.
globalLocationNumber: (Union[List[Union[str, Any]], str, Any]): The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.
amenityFeature: (Optional[Union[List[Union[str, Any]], str, Any]]): An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.
additionalProperty: (Optional[Union[List[Union[str, Any]], str, Any]]): A property-value pair representing an additional characteristic of the entity, e.g. a product feature or another characteristic for which there is no matching property in schema.org.Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.
slogan: (Union[List[Union[str, Any]], str, Any]): A slogan or motto associated with the item.
photos: (Optional[Union[List[Union[str, Any]], str, Any]]): Photographs of this place.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
tourBookingPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.
geoWithin: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
containsPlace: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and another that it contains.
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
hasMap: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
containedIn: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and one that contains it.
events: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past events associated with this place or organization.
geoOverlaps: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
geoEquals: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship).
maps: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
isAccessibleForFree: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the item, event, or place is accessible for free.
event: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past event associated with this place, organization, or action.
photo: (Optional[Union[List[Union[str, Any]], str, Any]]): A photograph of this place.
containedInPlace: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and one that contains it.
logo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An associated logo.
geoCrosses: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
address: (Union[List[Union[str, Any]], str, Any]): Physical address of the item.
geo: (Optional[Union[List[Union[str, Any]], str, Any]]): The geo coordinates of the place.
openingHoursSpecification: (Optional[Union[List[Union[str, Any]], str, Any]]): The opening hours of a certain place.
geoDisjoint: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: "they have no point in common. They form a set of disconnected geometries." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)
geoIntersects: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
latitude: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).
maximumAttendeeCapacity: (Optional[Union[List[Union[str, int, Any]], str, int, Any]]): The total number of individuals that may attend an event or venue.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
map: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
branchCode: (Union[List[Union[str, Any]], str, Any]): A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs.For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.
faxNumber: (Union[List[Union[str, Any]], str, Any]): The fax number.
publicAccess: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value
geoTouches: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) touch: "they have at least one boundary point in common, but no interior points." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)
geoCoveredBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
telephone: (Union[List[Union[str, Any]], str, Any]): The telephone number.
hasDriveThroughService: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.
specialOpeningHoursSpecification: (Optional[Union[List[Union[str, Any]], str, Any]]): The special opening hours of a certain place.Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]].
geoContains: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
priceRange: (Union[List[Union[str, Any]], str, Any]): The price range of the business, for example ```$$$```.
currenciesAccepted: (Union[List[Union[str, Any]], str, Any]): The currency accepted.Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217), e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types, e.g. "Ithaca HOUR".
branchOf: (Optional[Union[List[Union[str, Any]], str, Any]]): The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical) [[branch]].
paymentAccepted: (Union[List[Union[str, Any]], str, Any]): Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.
openingHours: (Union[List[Union[str, Any]], str, Any]): The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas ',' separating each day. Day or time ranges are specified using a hyphen '-'.* Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```.* Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: <code><time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays and Thursdays 4-8pm</time></code>.* If a business is open 7 days a week, then it can be specified as <code><time itemprop="openingHours" datetime="Mo-Su">Monday through Sunday, all day</time></code>.
"""
type_: str = Field(default="ArtGallery", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
serviceArea: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The geographic area where the service is provided.",
)
founder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person who founded this organization.",
)
isicV4: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The International Standard of Industrial Classification of All Economic Activities"
"(ISIC), Revision 4 code for a particular organization, business person, or place.",
)
hasPOS: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Points-of-Sales operated by the organization or person.",
)
globalLocationNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred"
"to as International Location Number or ILN) of the respective organization, person,"
"or place. The GLN is a 13-digit number used to identify parties and physical locations.",
)
member: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A member of an Organization or a ProgramMembership. Organizations can be members of"
"organizations; ProgramMembership is typically for individuals.",
)
knowsAbout: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that"
"is known about - suggesting possible expertise but not implying it. We do not distinguish"
"skill levels here, or relate this to educational content, events, objectives or [[JobPosting]]"
"descriptions.",
)
makesOffer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to products or services offered by the organization or person.",
)
ownershipFundingInfo: Union[
List[Union[str, AnyUrl, Any]], str, AnyUrl, Any
] = Field(
default=None,
description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]),"
"a description of organizational ownership structure; funding and grants. In a news/media"
"setting, this is with particular reference to editorial independence. Note that the"
"[[funder]] is also available and can be used to make basic funder information machine-readable.",
)
founders: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person who founded this organization.",
)
legalName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The official name of the organization, e.g. the registered company name.",
)
actionableFeedbackPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement"
"about public engagement activities (for news media, the newsroom’s), including involving"
"the public - digitally or otherwise -- in coverage decisions, reporting and activities"
"after publication.",
)
areaServed: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The geographic area where a service or offered item is provided.",
)
parentOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The larger organization that this organization is a [[subOrganization]] of, if any.",
)
slogan: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A slogan or motto associated with the item.",
)
department: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A relationship between an organization and a department of that organization, also"
"described as an organization (allowing different urls, logos, opening hours). For"
"example: a store with a pharmacy, or a bakery with a cafe.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
memberOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An Organization (or ProgramMembership) to which this Person or Organization belongs.",
)
publishingPrinciples: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing"
"the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]]"
"writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity"
"policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles"
"are those of the party primarily responsible for the creation of the [[CreativeWork]].While"
"such policies are most typically expressed in natural language, sometimes related"
"information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.",
)
employee: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Someone working for this organization.",
)
award: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An award won by or for this item.",
)
email: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Email address.",
)
contactPoints: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A contact point for a person or organization.",
)
diversityStaffingReport: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]),"
"a report on staffing diversity issues. In a news context this might be for example ASNE"
"or RTDNA (US) reports, or self-reported.",
)
foundingDate: Optional[Union[List[Union[str, Any, date]], str, Any, date]] = Field(
default=None,
description="The date that this organization was founded.",
)
owns: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Products owned by the organization or person.",
)
awards: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Awards won by or for this item.",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
dissolutionDate: Optional[
Union[List[Union[str, Any, date]], str, Any, date]
] = Field(
default=None,
description="The date that this organization was dissolved.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
interactionStatistic: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication."
"The most specific child type of InteractionCounter should be used.",
)
events: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past events associated with this place or organization.",
)
seeks: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to products or services sought by the organization or person (demand).",
)
employees: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="People working for this organization.",
)
unnamedSourcesPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about"
"policy on use of unnamed sources and the decision process required.",
)
subOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A relationship between two organizations where the first includes the second, e.g.,"
"as a subsidiary. See also: the more specific 'department' property.",
)
foundingLocation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The place where the Organization was founded.",
)
funder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports (sponsors) something through some kind of financial"
"contribution.",
)
iso6523Code: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An organization identifier as defined in ISO 6523(-1). Note that many existing organization"
"identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns)"
"and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier"
"by setting the ICD part of the ISO 6523 identifier accordingly.",
)
diversityPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]."
"For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity"
"policy on both staffing and sources, typically providing staffing data.",
)
hasMerchantReturnPolicy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies a MerchantReturnPolicy that may be applicable.",
)
event: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past event associated with this place, organization, or action.",
)
duns: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Dun & Bradstreet DUNS number for identifying an organization or business person.",
)
alumni: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Alumni of an organization.",
)
ethicsPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic"
"and publishing practices, or of a [[Restaurant]], a page describing food source policies."
"In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement"
"describing the personal, organizational, and corporate standards of behavior expected"
"by the organization.",
)
leiCode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An organization identifier that uniquely identifies a legal entity as defined in ISO"
"17442.",
)
vatID: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Value-added Tax ID of the organization or person.",
)
knowsLanguage: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Of a [[Person]], and less typically of an [[Organization]], to indicate a known language."
"We do not distinguish skill levels or reading/writing/speaking/signing here. Use"
"language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).",
)
correctionsPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing"
"(in news media, the newsroom’s) disclosure and correction policy for errors.",
)
logo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An associated logo.",
)
hasCredential: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A credential awarded to the Person or Organization.",
)
address: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Physical address of the item.",
)
brand: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The brand(s) associated with a product or service, or the brand(s) maintained by an organization"
"or business person.",
)
nonprofitStatus: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="nonprofitStatus indicates the legal status of a non-profit organization in its primary"
"place of business.",
)
contactPoint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A contact point for a person or organization.",
)
hasOfferCatalog: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates an OfferCatalog listing for this Organization, Person, or Service.",
)
members: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A member of this organization.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
faxNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The fax number.",
)
telephone: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The telephone number.",
)
taxID: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in"
"Spain.",
)
naics: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The North American Industry Classification System (NAICS) code for a particular organization"
"or business person.",
)
location: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The location of, for example, where an event is happening, where an organization is located,"
"or where an action takes place.",
)
numberOfEmployees: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of employees in an organization, e.g. business.",
)
sponsor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports a thing through a pledge, promise, or financial"
"contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.",
)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
geoCovers: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a covering geometry to a covered geometry. "Every point of b is a point of (the interior'
'or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).',
)
longitude: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).",
)
smokingAllowed: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or"
"hotel room.",
)
isicV4: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The International Standard of Industrial Classification of All Economic Activities"
"(ISIC), Revision 4 code for a particular organization, business person, or place.",
)
globalLocationNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred"
"to as International Location Number or ILN) of the respective organization, person,"
"or place. The GLN is a 13-digit number used to identify parties and physical locations.",
)
amenityFeature: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic"
"property does not make a statement about whether the feature is included in an offer for"
"the main accommodation or available at extra costs.",
)
additionalProperty: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A property-value pair representing an additional characteristic of the entity, e.g."
"a product feature or another characteristic for which there is no matching property"
"in schema.org.Note: Publishers should be aware that applications designed to use specific"
"schema.org properties (e.g. https://schema.org/width, https://schema.org/color,"
"https://schema.org/gtin13, ...) will typically expect such data to be provided using"
"those properties, rather than using the generic property/value mechanism.",
)
slogan: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A slogan or motto associated with the item.",
)
photos: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Photographs of this place.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
tourBookingPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]]"
"or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.",
)
geoWithin: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined"
"in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
containsPlace: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and another that it contains.",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
hasMap: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
containedIn: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and one that contains it.",
)
events: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past events associated with this place or organization.",
)
geoOverlaps: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to another that geospatially overlaps it, i.e. they have some but not all points"
"in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
geoEquals: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
"are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM)."
'"Two geometries are topologically equal if their interiors intersect and no part of'
'the interior or boundary of one geometry intersects the exterior of the other" (a symmetric'
"relationship).",
)
maps: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
isAccessibleForFree: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the item, event, or place is accessible for free.",
)
event: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past event associated with this place, organization, or action.",
)
photo: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A photograph of this place.",
)
containedInPlace: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and one that contains it.",
)
logo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An associated logo.",
)
geoCrosses: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a geometry to another that crosses it: "a crosses b: they have some but not all interior'
"points in common, and the dimension of the intersection is less than that of at least one"
'of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).',
)
address: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Physical address of the item.",
)
geo: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The geo coordinates of the place.",
)
openingHoursSpecification: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The opening hours of a certain place.",
)
geoDisjoint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
'are topologically disjoint: "they have no point in common. They form a set of disconnected'
'geometries." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)',
)
geoIntersects: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
"have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
latitude: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).",
)
maximumAttendeeCapacity: Optional[
Union[List[Union[str, int, Any]], str, int, Any]
] = Field(
default=None,
description="The total number of individuals that may attend an event or venue.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
map: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
branchCode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description='A short textual code (also called "store code") that uniquely identifies a place of'
"business. The code is typically assigned by the parentOrganization and used in structured"
"URLs.For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047"
'the code "3047" is a branchCode for a particular branch.',
)
faxNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The fax number.",
)
publicAccess: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the [[Place]] is open to public visitors. If this property is omitted"
"there is no assumed default boolean value",
)
geoTouches: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
'touch: "they have at least one boundary point in common, but no interior points." (A'
"symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)",
)
geoCoveredBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
telephone: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The telephone number.",
)
hasDriveThroughService: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]])"
"offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]]"
"such facilities could potentially help with social distancing from other potentially-infected"
"users.",
)
specialOpeningHoursSpecification: Optional[
Union[List[Union[str, Any]], str, Any]
] = Field(
default=None,
description="The special opening hours of a certain place.Use this to explicitly override general"
"opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]].",
)
geoContains: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a containing geometry to a contained geometry. "a contains b iff no points of b lie in'
'the exterior of a, and at least one point of the interior of b lies in the interior of a".'
"As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
priceRange: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The price range of the business, for example ```$$$```.",
)
currenciesAccepted: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The currency accepted.Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217),"
'e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies)'
'for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system)'
'(LETS) and other currency types, e.g. "Ithaca HOUR".',
)
branchOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The larger organization that this local business is a branch of, if any. Not to be confused"
"with (anatomical) [[branch]].",
)
paymentAccepted: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.",
)
openingHours: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The general opening hours for a business. Opening hours can be specified as a weekly time"
"range, starting with days, then times per day. Multiple days can be listed with commas"
"',' separating each day. Day or time ranges are specified using a hyphen '-'.* Days are"
"specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```,"
"```Th```, ```Fr```, ```Sa```, ```Su```.* Times are specified using 24:00 format."
"For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example:"
'<code><time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays'
"and Thursdays 4-8pm</time></code>.* If a business is open 7 days a week, then"
"it can be specified as <code><time itemprop="openingHours" datetime="Mo-Su">Monday"
"through Sunday, all day</time></code>.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/ArtGallery.py
| 0.877293 | 0.294562 |
ArtGallery.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class NonprofitType(BaseModel):
"""NonprofitType enumerates several kinds of official non-profit types of which a non-profit organization can be.
References:
https://schema.org/NonprofitType
Note:
Model Depth 4
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
supersededBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Relates a term (i.e. a property, class or enumeration) to one that supersedes it.
"""
type_: str = Field(default="NonprofitType", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
supersededBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/NonprofitType.py
| 0.946584 | 0.324971 |
NonprofitType.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class ReadAction(BaseModel):
"""The act of consuming written content.
References:
https://schema.org/ReadAction
Note:
Model Depth 4
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
endTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to end. For actions that span a period of time, when the action was performed. E.g. John wrote a book from January to *December*. For media, including audio and video, it's the time offset of the end of a clip within a larger file.Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.
provider: (Optional[Union[List[Union[str, Any]], str, Any]]): The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller.
startTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation), the time that it is expected to start. For actions that span a period of time, when the action was performed. E.g. John wrote a book from *January* to December. For media, including audio and video, it's the time offset of the start of a clip within a larger file.Note that Event uses startDate/endDate instead of startTime/endTime, even when describing dates with times. This situation may be clarified in future revisions.
result: (Optional[Union[List[Union[str, Any]], str, Any]]): The result produced in the action. E.g. John wrote *a book*.
actionStatus: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the current disposition of the Action.
agent: (Optional[Union[List[Union[str, Any]], str, Any]]): The direct performer or driver of the action (animate or inanimate). E.g. *John* wrote a book.
instrument: (Optional[Union[List[Union[str, Any]], str, Any]]): The object that helped the agent perform the action. E.g. John wrote a book with *a pen*.
object: (Optional[Union[List[Union[str, Any]], str, Any]]): The object upon which the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn't). E.g. John read *a book*.
error: (Optional[Union[List[Union[str, Any]], str, Any]]): For failed actions, more information on the cause of the failure.
target: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a target EntryPoint, or url, for an Action.
location: (Union[List[Union[str, Any]], str, Any]): The location of, for example, where an event is happening, where an organization is located, or where an action takes place.
participant: (Optional[Union[List[Union[str, Any]], str, Any]]): Other co-agents that participated in the action indirectly. E.g. John wrote a book with *Steve*.
actionAccessibilityRequirement: (Optional[Union[List[Union[str, Any]], str, Any]]): A set of requirements that must be fulfilled in order to perform an Action. If more than one value is specified, fulfilling one set of requirements will allow the Action to be performed.
expectsAcceptanceOf: (Optional[Union[List[Union[str, Any]], str, Any]]): An Offer which must be accepted before the user can perform the Action. For example, the user may need to buy a movie before being able to watch it.
"""
type_: str = Field(default="ReadAction", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
endTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation),"
"the time that it is expected to end. For actions that span a period of time, when the action"
"was performed. E.g. John wrote a book from January to *December*. For media, including"
"audio and video, it's the time offset of the end of a clip within a larger file.Note that"
"Event uses startDate/endDate instead of startTime/endTime, even when describing"
"dates with times. This situation may be clarified in future revisions.",
)
provider: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The service provider, service operator, or service performer; the goods producer."
"Another party (a seller) may offer those services or goods on behalf of the provider."
"A provider may also serve as the seller.",
)
startTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation),"
"the time that it is expected to start. For actions that span a period of time, when the action"
"was performed. E.g. John wrote a book from *January* to December. For media, including"
"audio and video, it's the time offset of the start of a clip within a larger file.Note that"
"Event uses startDate/endDate instead of startTime/endTime, even when describing"
"dates with times. This situation may be clarified in future revisions.",
)
result: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The result produced in the action. E.g. John wrote *a book*.",
)
actionStatus: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the current disposition of the Action.",
)
agent: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The direct performer or driver of the action (animate or inanimate). E.g. *John* wrote"
"a book.",
)
instrument: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The object that helped the agent perform the action. E.g. John wrote a book with *a pen*.",
)
object: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The object upon which the action is carried out, whose state is kept intact or changed."
"Also known as the semantic roles patient, affected or undergoer (which change their"
"state) or theme (which doesn't). E.g. John read *a book*.",
)
error: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="For failed actions, more information on the cause of the failure.",
)
target: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="Indicates a target EntryPoint, or url, for an Action.",
)
location: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The location of, for example, where an event is happening, where an organization is located,"
"or where an action takes place.",
)
participant: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Other co-agents that participated in the action indirectly. E.g. John wrote a book with"
"*Steve*.",
)
actionAccessibilityRequirement: Optional[
Union[List[Union[str, Any]], str, Any]
] = Field(
default=None,
description="A set of requirements that must be fulfilled in order to perform an Action. If more than"
"one value is specified, fulfilling one set of requirements will allow the Action to be"
"performed.",
)
expectsAcceptanceOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An Offer which must be accepted before the user can perform the Action. For example, the"
"user may need to buy a movie before being able to watch it.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/ReadAction.py
| 0.930978 | 0.399958 |
ReadAction.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class Genitourinary(BaseModel):
"""Genitourinary system function assessment with clinical examination.
References:
https://schema.org/Genitourinary
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
supersededBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Relates a term (i.e. a property, class or enumeration) to one that supersedes it.
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
recognizingAuthority: (Optional[Union[List[Union[str, Any]], str, Any]]): If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.
relevantSpecialty: (Optional[Union[List[Union[str, Any]], str, Any]]): If applicable, a medical specialty in which this entity is relevant.
medicineSystem: (Optional[Union[List[Union[str, Any]], str, Any]]): The system of medicine that includes this MedicalEntity, for example 'evidence-based', 'homeopathic', 'chiropractic', etc.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
legalStatus: (Union[List[Union[str, Any]], str, Any]): The drug or supplement's legal status, including any controlled substance schedules that apply.
study: (Optional[Union[List[Union[str, Any]], str, Any]]): A medical study or trial related to this entity.
guideline: (Optional[Union[List[Union[str, Any]], str, Any]]): A medical guideline related to this entity.
code: (Optional[Union[List[Union[str, Any]], str, Any]]): A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.
howPerformed: (Union[List[Union[str, Any]], str, Any]): How the procedure is performed.
procedureType: (Optional[Union[List[Union[str, Any]], str, Any]]): The type of procedure, for example Surgical, Noninvasive, or Percutaneous.
status: (Union[List[Union[str, Any]], str, Any]): The status of the study (enumerated).
bodyLocation: (Union[List[Union[str, Any]], str, Any]): Location in the body of the anatomical structure.
followup: (Union[List[Union[str, Any]], str, Any]): Typical or recommended followup care after the procedure is performed.
preparation: (Union[List[Union[str, Any]], str, Any]): Typical preparation that a patient must undergo before having the procedure performed.
"""
type_: str = Field(default="Genitourinary", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
supersededBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.",
)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
recognizingAuthority: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="If applicable, the organization that officially recognizes this entity as part of its"
"endorsed system of medicine.",
)
relevantSpecialty: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="If applicable, a medical specialty in which this entity is relevant.",
)
medicineSystem: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The system of medicine that includes this MedicalEntity, for example 'evidence-based',"
"'homeopathic', 'chiropractic', etc.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
legalStatus: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The drug or supplement's legal status, including any controlled substance schedules"
"that apply.",
)
study: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A medical study or trial related to this entity.",
)
guideline: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A medical guideline related to this entity.",
)
code: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A medical code for the entity, taken from a controlled vocabulary or ontology such as"
"ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.",
)
howPerformed: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="How the procedure is performed.",
)
procedureType: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The type of procedure, for example Surgical, Noninvasive, or Percutaneous.",
)
status: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The status of the study (enumerated).",
)
bodyLocation: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Location in the body of the anatomical structure.",
)
followup: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Typical or recommended followup care after the procedure is performed.",
)
preparation: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Typical preparation that a patient must undergo before having the procedure performed.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/Genitourinary.py
| 0.90627 | 0.366108 |
Genitourinary.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class Distillery(BaseModel):
"""A distillery.
References:
https://schema.org/Distillery
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
serviceArea: (Optional[Union[List[Union[str, Any]], str, Any]]): The geographic area where the service is provided.
founder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person who founded this organization.
isicV4: (Union[List[Union[str, Any]], str, Any]): The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.
hasPOS: (Optional[Union[List[Union[str, Any]], str, Any]]): Points-of-Sales operated by the organization or person.
globalLocationNumber: (Union[List[Union[str, Any]], str, Any]): The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.
member: (Optional[Union[List[Union[str, Any]], str, Any]]): A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.
knowsAbout: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.
makesOffer: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to products or services offered by the organization or person.
ownershipFundingInfo: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.
founders: (Optional[Union[List[Union[str, Any]], str, Any]]): A person who founded this organization.
legalName: (Union[List[Union[str, Any]], str, Any]): The official name of the organization, e.g. the registered company name.
actionableFeedbackPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.
areaServed: (Union[List[Union[str, Any]], str, Any]): The geographic area where a service or offered item is provided.
parentOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): The larger organization that this organization is a [[subOrganization]] of, if any.
slogan: (Union[List[Union[str, Any]], str, Any]): A slogan or motto associated with the item.
department: (Optional[Union[List[Union[str, Any]], str, Any]]): A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
memberOf: (Optional[Union[List[Union[str, Any]], str, Any]]): An Organization (or ProgramMembership) to which this Person or Organization belongs.
publishingPrinciples: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]].While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.
employee: (Optional[Union[List[Union[str, Any]], str, Any]]): Someone working for this organization.
award: (Union[List[Union[str, Any]], str, Any]): An award won by or for this item.
email: (Union[List[Union[str, Any]], str, Any]): Email address.
contactPoints: (Optional[Union[List[Union[str, Any]], str, Any]]): A contact point for a person or organization.
diversityStaffingReport: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.
foundingDate: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): The date that this organization was founded.
owns: (Optional[Union[List[Union[str, Any]], str, Any]]): Products owned by the organization or person.
awards: (Union[List[Union[str, Any]], str, Any]): Awards won by or for this item.
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
dissolutionDate: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): The date that this organization was dissolved.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
interactionStatistic: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.
events: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past events associated with this place or organization.
seeks: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to products or services sought by the organization or person (demand).
employees: (Optional[Union[List[Union[str, Any]], str, Any]]): People working for this organization.
unnamedSourcesPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.
subOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific 'department' property.
foundingLocation: (Optional[Union[List[Union[str, Any]], str, Any]]): The place where the Organization was founded.
funder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports (sponsors) something through some kind of financial contribution.
iso6523Code: (Union[List[Union[str, Any]], str, Any]): An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly.
diversityPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.
hasMerchantReturnPolicy: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies a MerchantReturnPolicy that may be applicable.
event: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past event associated with this place, organization, or action.
duns: (Union[List[Union[str, Any]], str, Any]): The Dun & Bradstreet DUNS number for identifying an organization or business person.
alumni: (Optional[Union[List[Union[str, Any]], str, Any]]): Alumni of an organization.
ethicsPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.
leiCode: (Union[List[Union[str, Any]], str, Any]): An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.
vatID: (Union[List[Union[str, Any]], str, Any]): The Value-added Tax ID of the organization or person.
knowsLanguage: (Union[List[Union[str, Any]], str, Any]): Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).
correctionsPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.
logo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An associated logo.
hasCredential: (Optional[Union[List[Union[str, Any]], str, Any]]): A credential awarded to the Person or Organization.
address: (Union[List[Union[str, Any]], str, Any]): Physical address of the item.
brand: (Optional[Union[List[Union[str, Any]], str, Any]]): The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.
nonprofitStatus: (Optional[Union[List[Union[str, Any]], str, Any]]): nonprofitStatus indicates the legal status of a non-profit organization in its primary place of business.
contactPoint: (Optional[Union[List[Union[str, Any]], str, Any]]): A contact point for a person or organization.
hasOfferCatalog: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates an OfferCatalog listing for this Organization, Person, or Service.
members: (Optional[Union[List[Union[str, Any]], str, Any]]): A member of this organization.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
faxNumber: (Union[List[Union[str, Any]], str, Any]): The fax number.
telephone: (Union[List[Union[str, Any]], str, Any]): The telephone number.
taxID: (Union[List[Union[str, Any]], str, Any]): The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.
naics: (Union[List[Union[str, Any]], str, Any]): The North American Industry Classification System (NAICS) code for a particular organization or business person.
location: (Union[List[Union[str, Any]], str, Any]): The location of, for example, where an event is happening, where an organization is located, or where an action takes place.
numberOfEmployees: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of employees in an organization, e.g. business.
sponsor: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
geoCovers: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
longitude: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).
smokingAllowed: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.
isicV4: (Union[List[Union[str, Any]], str, Any]): The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.
globalLocationNumber: (Union[List[Union[str, Any]], str, Any]): The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.
amenityFeature: (Optional[Union[List[Union[str, Any]], str, Any]]): An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.
additionalProperty: (Optional[Union[List[Union[str, Any]], str, Any]]): A property-value pair representing an additional characteristic of the entity, e.g. a product feature or another characteristic for which there is no matching property in schema.org.Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.
slogan: (Union[List[Union[str, Any]], str, Any]): A slogan or motto associated with the item.
photos: (Optional[Union[List[Union[str, Any]], str, Any]]): Photographs of this place.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
tourBookingPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.
geoWithin: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
containsPlace: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and another that it contains.
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
hasMap: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
containedIn: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and one that contains it.
events: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past events associated with this place or organization.
geoOverlaps: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
geoEquals: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship).
maps: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
isAccessibleForFree: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the item, event, or place is accessible for free.
event: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past event associated with this place, organization, or action.
photo: (Optional[Union[List[Union[str, Any]], str, Any]]): A photograph of this place.
containedInPlace: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and one that contains it.
logo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An associated logo.
geoCrosses: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
address: (Union[List[Union[str, Any]], str, Any]): Physical address of the item.
geo: (Optional[Union[List[Union[str, Any]], str, Any]]): The geo coordinates of the place.
openingHoursSpecification: (Optional[Union[List[Union[str, Any]], str, Any]]): The opening hours of a certain place.
geoDisjoint: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: "they have no point in common. They form a set of disconnected geometries." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)
geoIntersects: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
latitude: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).
maximumAttendeeCapacity: (Optional[Union[List[Union[str, int, Any]], str, int, Any]]): The total number of individuals that may attend an event or venue.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
map: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
branchCode: (Union[List[Union[str, Any]], str, Any]): A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs.For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.
faxNumber: (Union[List[Union[str, Any]], str, Any]): The fax number.
publicAccess: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value
geoTouches: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) touch: "they have at least one boundary point in common, but no interior points." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)
geoCoveredBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
telephone: (Union[List[Union[str, Any]], str, Any]): The telephone number.
hasDriveThroughService: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.
specialOpeningHoursSpecification: (Optional[Union[List[Union[str, Any]], str, Any]]): The special opening hours of a certain place.Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]].
geoContains: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
priceRange: (Union[List[Union[str, Any]], str, Any]): The price range of the business, for example ```$$$```.
currenciesAccepted: (Union[List[Union[str, Any]], str, Any]): The currency accepted.Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217), e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types, e.g. "Ithaca HOUR".
branchOf: (Optional[Union[List[Union[str, Any]], str, Any]]): The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical) [[branch]].
paymentAccepted: (Union[List[Union[str, Any]], str, Any]): Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.
openingHours: (Union[List[Union[str, Any]], str, Any]): The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas ',' separating each day. Day or time ranges are specified using a hyphen '-'.* Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```.* Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: <code><time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays and Thursdays 4-8pm</time></code>.* If a business is open 7 days a week, then it can be specified as <code><time itemprop="openingHours" datetime="Mo-Su">Monday through Sunday, all day</time></code>.
starRating: (Optional[Union[List[Union[str, Any]], str, Any]]): An official rating for a lodging business or food establishment, e.g. from national associations or standards bodies. Use the author property to indicate the rating organization, e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).
servesCuisine: (Union[List[Union[str, Any]], str, Any]): The cuisine of the restaurant.
acceptsReservations: (Union[List[Union[str, StrictBool, AnyUrl, Any]], str, StrictBool, AnyUrl, Any]): Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean, an URL at which reservations can be made or (for backwards compatibility) the strings ```Yes``` or ```No```.
menu: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Either the actual menu as a structured representation, as text, or a URL of the menu.
hasMenu: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Either the actual menu as a structured representation, as text, or a URL of the menu.
"""
type_: str = Field(default="Distillery", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
serviceArea: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The geographic area where the service is provided.",
)
founder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person who founded this organization.",
)
isicV4: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The International Standard of Industrial Classification of All Economic Activities"
"(ISIC), Revision 4 code for a particular organization, business person, or place.",
)
hasPOS: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Points-of-Sales operated by the organization or person.",
)
globalLocationNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred"
"to as International Location Number or ILN) of the respective organization, person,"
"or place. The GLN is a 13-digit number used to identify parties and physical locations.",
)
member: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A member of an Organization or a ProgramMembership. Organizations can be members of"
"organizations; ProgramMembership is typically for individuals.",
)
knowsAbout: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that"
"is known about - suggesting possible expertise but not implying it. We do not distinguish"
"skill levels here, or relate this to educational content, events, objectives or [[JobPosting]]"
"descriptions.",
)
makesOffer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to products or services offered by the organization or person.",
)
ownershipFundingInfo: Union[
List[Union[str, AnyUrl, Any]], str, AnyUrl, Any
] = Field(
default=None,
description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]),"
"a description of organizational ownership structure; funding and grants. In a news/media"
"setting, this is with particular reference to editorial independence. Note that the"
"[[funder]] is also available and can be used to make basic funder information machine-readable.",
)
founders: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person who founded this organization.",
)
legalName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The official name of the organization, e.g. the registered company name.",
)
actionableFeedbackPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement"
"about public engagement activities (for news media, the newsroom’s), including involving"
"the public - digitally or otherwise -- in coverage decisions, reporting and activities"
"after publication.",
)
areaServed: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The geographic area where a service or offered item is provided.",
)
parentOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The larger organization that this organization is a [[subOrganization]] of, if any.",
)
slogan: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A slogan or motto associated with the item.",
)
department: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A relationship between an organization and a department of that organization, also"
"described as an organization (allowing different urls, logos, opening hours). For"
"example: a store with a pharmacy, or a bakery with a cafe.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
memberOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An Organization (or ProgramMembership) to which this Person or Organization belongs.",
)
publishingPrinciples: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing"
"the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]]"
"writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity"
"policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles"
"are those of the party primarily responsible for the creation of the [[CreativeWork]].While"
"such policies are most typically expressed in natural language, sometimes related"
"information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.",
)
employee: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Someone working for this organization.",
)
award: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An award won by or for this item.",
)
email: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Email address.",
)
contactPoints: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A contact point for a person or organization.",
)
diversityStaffingReport: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]),"
"a report on staffing diversity issues. In a news context this might be for example ASNE"
"or RTDNA (US) reports, or self-reported.",
)
foundingDate: Optional[Union[List[Union[str, Any, date]], str, Any, date]] = Field(
default=None,
description="The date that this organization was founded.",
)
owns: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Products owned by the organization or person.",
)
awards: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Awards won by or for this item.",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
dissolutionDate: Optional[
Union[List[Union[str, Any, date]], str, Any, date]
] = Field(
default=None,
description="The date that this organization was dissolved.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
interactionStatistic: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication."
"The most specific child type of InteractionCounter should be used.",
)
events: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past events associated with this place or organization.",
)
seeks: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to products or services sought by the organization or person (demand).",
)
employees: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="People working for this organization.",
)
unnamedSourcesPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about"
"policy on use of unnamed sources and the decision process required.",
)
subOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A relationship between two organizations where the first includes the second, e.g.,"
"as a subsidiary. See also: the more specific 'department' property.",
)
foundingLocation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The place where the Organization was founded.",
)
funder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports (sponsors) something through some kind of financial"
"contribution.",
)
iso6523Code: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An organization identifier as defined in ISO 6523(-1). Note that many existing organization"
"identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns)"
"and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier"
"by setting the ICD part of the ISO 6523 identifier accordingly.",
)
diversityPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]."
"For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity"
"policy on both staffing and sources, typically providing staffing data.",
)
hasMerchantReturnPolicy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies a MerchantReturnPolicy that may be applicable.",
)
event: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past event associated with this place, organization, or action.",
)
duns: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Dun & Bradstreet DUNS number for identifying an organization or business person.",
)
alumni: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Alumni of an organization.",
)
ethicsPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic"
"and publishing practices, or of a [[Restaurant]], a page describing food source policies."
"In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement"
"describing the personal, organizational, and corporate standards of behavior expected"
"by the organization.",
)
leiCode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An organization identifier that uniquely identifies a legal entity as defined in ISO"
"17442.",
)
vatID: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Value-added Tax ID of the organization or person.",
)
knowsLanguage: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Of a [[Person]], and less typically of an [[Organization]], to indicate a known language."
"We do not distinguish skill levels or reading/writing/speaking/signing here. Use"
"language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).",
)
correctionsPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing"
"(in news media, the newsroom’s) disclosure and correction policy for errors.",
)
logo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An associated logo.",
)
hasCredential: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A credential awarded to the Person or Organization.",
)
address: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Physical address of the item.",
)
brand: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The brand(s) associated with a product or service, or the brand(s) maintained by an organization"
"or business person.",
)
nonprofitStatus: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="nonprofitStatus indicates the legal status of a non-profit organization in its primary"
"place of business.",
)
contactPoint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A contact point for a person or organization.",
)
hasOfferCatalog: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates an OfferCatalog listing for this Organization, Person, or Service.",
)
members: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A member of this organization.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
faxNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The fax number.",
)
telephone: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The telephone number.",
)
taxID: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in"
"Spain.",
)
naics: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The North American Industry Classification System (NAICS) code for a particular organization"
"or business person.",
)
location: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The location of, for example, where an event is happening, where an organization is located,"
"or where an action takes place.",
)
numberOfEmployees: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of employees in an organization, e.g. business.",
)
sponsor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports a thing through a pledge, promise, or financial"
"contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.",
)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
geoCovers: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a covering geometry to a covered geometry. "Every point of b is a point of (the interior'
'or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).',
)
longitude: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).",
)
smokingAllowed: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or"
"hotel room.",
)
isicV4: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The International Standard of Industrial Classification of All Economic Activities"
"(ISIC), Revision 4 code for a particular organization, business person, or place.",
)
globalLocationNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred"
"to as International Location Number or ILN) of the respective organization, person,"
"or place. The GLN is a 13-digit number used to identify parties and physical locations.",
)
amenityFeature: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic"
"property does not make a statement about whether the feature is included in an offer for"
"the main accommodation or available at extra costs.",
)
additionalProperty: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A property-value pair representing an additional characteristic of the entity, e.g."
"a product feature or another characteristic for which there is no matching property"
"in schema.org.Note: Publishers should be aware that applications designed to use specific"
"schema.org properties (e.g. https://schema.org/width, https://schema.org/color,"
"https://schema.org/gtin13, ...) will typically expect such data to be provided using"
"those properties, rather than using the generic property/value mechanism.",
)
slogan: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A slogan or motto associated with the item.",
)
photos: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Photographs of this place.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
tourBookingPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]]"
"or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.",
)
geoWithin: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined"
"in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
containsPlace: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and another that it contains.",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
hasMap: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
containedIn: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and one that contains it.",
)
events: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past events associated with this place or organization.",
)
geoOverlaps: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to another that geospatially overlaps it, i.e. they have some but not all points"
"in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
geoEquals: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
"are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM)."
'"Two geometries are topologically equal if their interiors intersect and no part of'
'the interior or boundary of one geometry intersects the exterior of the other" (a symmetric'
"relationship).",
)
maps: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
isAccessibleForFree: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the item, event, or place is accessible for free.",
)
event: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past event associated with this place, organization, or action.",
)
photo: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A photograph of this place.",
)
containedInPlace: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and one that contains it.",
)
logo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An associated logo.",
)
geoCrosses: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a geometry to another that crosses it: "a crosses b: they have some but not all interior'
"points in common, and the dimension of the intersection is less than that of at least one"
'of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).',
)
address: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Physical address of the item.",
)
geo: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The geo coordinates of the place.",
)
openingHoursSpecification: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The opening hours of a certain place.",
)
geoDisjoint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
'are topologically disjoint: "they have no point in common. They form a set of disconnected'
'geometries." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)',
)
geoIntersects: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
"have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
latitude: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).",
)
maximumAttendeeCapacity: Optional[
Union[List[Union[str, int, Any]], str, int, Any]
] = Field(
default=None,
description="The total number of individuals that may attend an event or venue.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
map: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
branchCode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description='A short textual code (also called "store code") that uniquely identifies a place of'
"business. The code is typically assigned by the parentOrganization and used in structured"
"URLs.For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047"
'the code "3047" is a branchCode for a particular branch.',
)
faxNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The fax number.",
)
publicAccess: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the [[Place]] is open to public visitors. If this property is omitted"
"there is no assumed default boolean value",
)
geoTouches: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
'touch: "they have at least one boundary point in common, but no interior points." (A'
"symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)",
)
geoCoveredBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
telephone: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The telephone number.",
)
hasDriveThroughService: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]])"
"offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]]"
"such facilities could potentially help with social distancing from other potentially-infected"
"users.",
)
specialOpeningHoursSpecification: Optional[
Union[List[Union[str, Any]], str, Any]
] = Field(
default=None,
description="The special opening hours of a certain place.Use this to explicitly override general"
"opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]].",
)
geoContains: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a containing geometry to a contained geometry. "a contains b iff no points of b lie in'
'the exterior of a, and at least one point of the interior of b lies in the interior of a".'
"As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
priceRange: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The price range of the business, for example ```$$$```.",
)
currenciesAccepted: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The currency accepted.Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217),"
'e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies)'
'for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system)'
'(LETS) and other currency types, e.g. "Ithaca HOUR".',
)
branchOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The larger organization that this local business is a branch of, if any. Not to be confused"
"with (anatomical) [[branch]].",
)
paymentAccepted: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.",
)
openingHours: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The general opening hours for a business. Opening hours can be specified as a weekly time"
"range, starting with days, then times per day. Multiple days can be listed with commas"
"',' separating each day. Day or time ranges are specified using a hyphen '-'.* Days are"
"specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```,"
"```Th```, ```Fr```, ```Sa```, ```Su```.* Times are specified using 24:00 format."
"For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example:"
'<code><time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays'
"and Thursdays 4-8pm</time></code>.* If a business is open 7 days a week, then"
"it can be specified as <code><time itemprop="openingHours" datetime="Mo-Su">Monday"
"through Sunday, all day</time></code>.",
)
starRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An official rating for a lodging business or food establishment, e.g. from national"
"associations or standards bodies. Use the author property to indicate the rating organization,"
"e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).",
)
servesCuisine: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The cuisine of the restaurant.",
)
acceptsReservations: Union[
List[Union[str, StrictBool, AnyUrl, Any]], str, StrictBool, AnyUrl, Any
] = Field(
default=None,
description="Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean,"
"an URL at which reservations can be made or (for backwards compatibility) the strings"
"```Yes``` or ```No```.",
)
menu: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Either the actual menu as a structured representation, as text, or a URL of the menu.",
)
hasMenu: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Either the actual menu as a structured representation, as text, or a URL of the menu.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/Distillery.py
| 0.884289 | 0.33876 |
Distillery.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class CoverArt(BaseModel):
"""The artwork on the outer surface of a CreativeWork.
References:
https://schema.org/CoverArt
Note:
Model Depth 4
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
workTranslation: (Optional[Union[List[Union[str, Any]], str, Any]]): A work that is a translation of the content of this work. E.g. 西遊記 has an English workTranslation “Journey to the West”, a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.
educationalLevel: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The level in terms of progression through an educational or training context. Examples of educational levels include 'beginner', 'intermediate' or 'advanced', and formal sets of level indicators.
associatedMedia: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork. This property is a synonym for encoding.
exampleOfWork: (Optional[Union[List[Union[str, Any]], str, Any]]): A creative work that this work is an example/instance/realization/derivation of.
releasedEvent: (Optional[Union[List[Union[str, Any]], str, Any]]): The place and time the release was issued, expressed as a PublicationEvent.
version: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The version of the CreativeWork embodied by a specified resource.
locationCreated: (Optional[Union[List[Union[str, Any]], str, Any]]): The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.
acquireLicensePage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.
thumbnailUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A thumbnail image relevant to the Thing.
provider: (Optional[Union[List[Union[str, Any]], str, Any]]): The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller.
expires: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.
contentLocation: (Optional[Union[List[Union[str, Any]], str, Any]]): The location depicted or described in the content. For example, the location in a photograph or painting.
educationalUse: (Union[List[Union[str, Any]], str, Any]): The purpose of a work in the context of education; for example, 'assignment', 'group work'.
copyrightHolder: (Optional[Union[List[Union[str, Any]], str, Any]]): The party holding the legal copyright to the CreativeWork.
accessibilityControl: (Union[List[Union[str, Any]], str, Any]): Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).
maintainer: (Optional[Union[List[Union[str, Any]], str, Any]]): A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.
educationalAlignment: (Optional[Union[List[Union[str, Any]], str, Any]]): An alignment to an established educational framework.This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.
spatial: (Optional[Union[List[Union[str, Any]], str, Any]]): The "spatial" property can be used in cases when more specific properties(e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.
publisher: (Optional[Union[List[Union[str, Any]], str, Any]]): The publisher of the creative work.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
assesses: (Union[List[Union[str, Any]], str, Any]): The item being described is intended to assess the competency or learning outcome defined by the referenced term.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
isBasedOn: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A resource from which this work is derived or from which it is a modification or adaption.
mentions: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.
publishingPrinciples: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]].While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.
contributor: (Optional[Union[List[Union[str, Any]], str, Any]]): A secondary contributor to the CreativeWork or Event.
license: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A license document that applies to this content, typically indicated by URL.
citation: (Union[List[Union[str, Any]], str, Any]): A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.
accessibilitySummary: (Union[List[Union[str, Any]], str, Any]): A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."
award: (Union[List[Union[str, Any]], str, Any]): An award won by or for this item.
commentCount: (Optional[Union[List[Union[str, int, Any]], str, int, Any]]): The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.
temporalCoverage: (Union[List[Union[datetime, str, Any, AnyUrl]], datetime, str, Any, AnyUrl]): The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content, e.g. ScholarlyArticle, Book, TVSeries or TVEpisode, may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945".Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.
dateCreated: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date on which the CreativeWork was created or the item was added to a DataFeed.
discussionUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A link to the page containing the comments of the CreativeWork.
copyrightNotice: (Union[List[Union[str, Any]], str, Any]): Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.
learningResourceType: (Union[List[Union[str, Any]], str, Any]): The predominant type or kind characterizing the learning resource. For example, 'presentation', 'handout'.
awards: (Union[List[Union[str, Any]], str, Any]): Awards won by or for this item.
accessModeSufficient: (Optional[Union[List[Union[str, Any]], str, Any]]): A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
conditionsOfAccess: (Union[List[Union[str, Any]], str, Any]): Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language.For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".
interactivityType: (Union[List[Union[str, Any]], str, Any]): The predominant mode of learning supported by the learning resource. Acceptable values are 'active', 'expositive', or 'mixed'.
abstract: (Union[List[Union[str, Any]], str, Any]): An abstract is a short description that summarizes a [[CreativeWork]].
fileFormat: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content, e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, 'encoding' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.
interpretedAsClaim: (Optional[Union[List[Union[str, Any]], str, Any]]): Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].
text: (Union[List[Union[str, Any]], str, Any]): The textual content of this CreativeWork.
archivedAt: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.
alternativeHeadline: (Union[List[Union[str, Any]], str, Any]): A secondary title of the CreativeWork.
creditText: (Union[List[Union[str, Any]], str, Any]): Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
interactionStatistic: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.
workExample: (Optional[Union[List[Union[str, Any]], str, Any]]): Example/instance/realization/derivation of the concept of this creative work. E.g. the paperback edition, first edition, or e-book.
about: (Optional[Union[List[Union[str, Any]], str, Any]]): The subject matter of the content.
encodings: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork.
funder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports (sponsors) something through some kind of financial contribution.
video: (Optional[Union[List[Union[str, Any]], str, Any]]): An embedded video object.
isPartOf: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.
pattern: (Union[List[Union[str, Any]], str, Any]): A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'. Values are typically expressed as text, although links to controlled value schemes are also supported.
editor: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the Person who edited the CreativeWork.
dateModified: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date on which the CreativeWork was most recently modified or when the item's entry was modified within a DataFeed.
translationOfWork: (Optional[Union[List[Union[str, Any]], str, Any]]): The work that this work has been translated from. E.g. 物种起源 is a translationOf “On the Origin of Species”.
creativeWorkStatus: (Union[List[Union[str, Any]], str, Any]): The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.
isBasedOnUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.
isFamilyFriendly: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether this content is family friendly.
isAccessibleForFree: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the item, event, or place is accessible for free.
author: (Optional[Union[List[Union[str, Any]], str, Any]]): The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.
contentReferenceTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.
correction: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.
sdDatePublished: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]
comment: (Optional[Union[List[Union[str, Any]], str, Any]]): Comments, typically from users.
countryOfOrigin: (Optional[Union[List[Union[str, Any]], str, Any]]): The country of origin of something, including products as well as creative works such as movie and TV content.In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable.In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.
timeRequired: (Optional[Union[List[Union[str, Any]], str, Any]]): Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.
typicalAgeRange: (Union[List[Union[str, Any]], str, Any]): The typical expected age range, e.g. '7-9', '11-'.
genre: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Genre of the creative work, broadcast channel or group.
producer: (Optional[Union[List[Union[str, Any]], str, Any]]): The person or organization who produced the work (e.g. music album, movie, TV/radio series etc.).
schemaVersion: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.
audience: (Optional[Union[List[Union[str, Any]], str, Any]]): An intended audience, i.e. a group for whom something was created.
encoding: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.
publisherImprint: (Optional[Union[List[Union[str, Any]], str, Any]]): The publishing division which published the comic.
accessibilityAPI: (Union[List[Union[str, Any]], str, Any]): Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).
sdPublisher: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The[[sdPublisher]] property helps make such practices more explicit.
audio: (Optional[Union[List[Union[str, Any]], str, Any]]): An embedded audio object.
accessibilityFeature: (Union[List[Union[str, Any]], str, Any]): Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).
spatialCoverage: (Optional[Union[List[Union[str, Any]], str, Any]]): The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.
accessMode: (Union[List[Union[str, Any]], str, Any]): The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).
editEIDR: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television.For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J" has several edits, e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3".Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description.
usageInfo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information, e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options.This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.
position: (Union[List[Union[str, int, Any]], str, int, Any]): The position of an item in a series or sequence of items.
encodingFormat: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)), e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information.Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.
copyrightYear: (Optional[Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]]): The year during which the claimed copyright for the CreativeWork was first asserted.
mainEntity: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the primary entity described in some page or other CreativeWork.
creator: (Optional[Union[List[Union[str, Any]], str, Any]]): The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.
teaches: (Union[List[Union[str, Any]], str, Any]): The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.
temporal: (Union[List[Union[datetime, str, Any]], datetime, str, Any]): The "temporal" property can be used in cases where more specific properties(e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.
size: (Union[List[Union[str, Any]], str, Any]): A standardized size of a product or creative work, specified either through a simple textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable.
translator: (Optional[Union[List[Union[str, Any]], str, Any]]): Organization or person who adapts a creative work to different languages, regional differences and technical requirements of a target market, or that translates during some event.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
accountablePerson: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the Person that is legally accountable for the CreativeWork.
accessibilityHazard: (Union[List[Union[str, Any]], str, Any]): A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).
contentRating: (Union[List[Union[str, Any]], str, Any]): Official rating of a piece of content—for example, 'MPAA PG-13'.
recordedAt: (Optional[Union[List[Union[str, Any]], str, Any]]): The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.
publication: (Optional[Union[List[Union[str, Any]], str, Any]]): A publication event associated with the item.
sdLicense: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A license document that applies to this structured data, typically indicated by URL.
headline: (Union[List[Union[str, Any]], str, Any]): Headline of the article.
materialExtent: (Union[List[Union[str, Any]], str, Any]): The quantity of the materials being described or an expression of the physical space they occupy.
inLanguage: (Union[List[Union[str, Any]], str, Any]): The language of the content or performance or used in an action. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[availableLanguage]].
material: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): A material that something is made from, e.g. leather, wool, cotton, paper.
datePublished: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): Date of first broadcast/publication.
offers: (Optional[Union[List[Union[str, Any]], str, Any]]): An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]] to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can also be used to describe a [[Demand]]. While this property is listed as expected on a number of common types, it can be used in others. In that case, using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.
hasPart: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).
sourceOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): The Organization on whose behalf the creator was working.
sponsor: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.
character: (Optional[Union[List[Union[str, Any]], str, Any]]): Fictional person connected with a creative work.
inker: (Optional[Union[List[Union[str, Any]], str, Any]]): The individual who traces over the pencil drawings in ink after pencils are complete.
width: (Optional[Union[List[Union[str, Any]], str, Any]]): The width of the item.
letterer: (Optional[Union[List[Union[str, Any]], str, Any]]): The individual who adds lettering, including speech balloons and sound effects, to artwork.
depth: (Optional[Union[List[Union[str, Any]], str, Any]]): The depth of the item.
penciler: (Optional[Union[List[Union[str, Any]], str, Any]]): The individual who draws the primary narrative artwork.
artist: (Optional[Union[List[Union[str, Any]], str, Any]]): The primary artist for a work in a medium other than pencils or digital line art--for example, if the primary artwork is done in watercolors or digital paints.
height: (Optional[Union[List[Union[str, Any]], str, Any]]): The height of the item.
colorist: (Optional[Union[List[Union[str, Any]], str, Any]]): The individual who adds color to inked drawings.
artMedium: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The material used. (E.g. Oil, Watercolour, Acrylic, Linoprint, Marble, Cyanotype, Digital, Lithograph, DryPoint, Intaglio, Pastel, Woodcut, Pencil, Mixed Media, etc.)
surface: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): A material used as a surface in some artwork, e.g. Canvas, Paper, Wood, Board, etc.
artform: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): e.g. Painting, Drawing, Sculpture, Print, Photograph, Assemblage, Collage, etc.
artEdition: (Union[List[Union[str, int, Any]], str, int, Any]): The number of copies when multiple copies of a piece of artwork are produced - e.g. for a limited edition of 20 prints, 'artEdition' refers to the total number of copies (in this example "20").
artworkSurface: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The supporting materials for the artwork, e.g. Canvas, Paper, Wood, Board, etc.
"""
type_: str = Field(default="CoverArt", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
workTranslation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A work that is a translation of the content of this work. E.g. 西遊記 has an English workTranslation"
"“Journey to the West”, a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese"
"translation Tây du ký bình khảo.",
)
educationalLevel: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The level in terms of progression through an educational or training context. Examples"
"of educational levels include 'beginner', 'intermediate' or 'advanced', and formal"
"sets of level indicators.",
)
associatedMedia: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork. This property is a synonym for encoding.",
)
exampleOfWork: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A creative work that this work is an example/instance/realization/derivation of.",
)
releasedEvent: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The place and time the release was issued, expressed as a PublicationEvent.",
)
version: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The version of the CreativeWork embodied by a specified resource.",
)
locationCreated: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The location where the CreativeWork was created, which may not be the same as the location"
"depicted in the CreativeWork.",
)
acquireLicensePage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page documenting how licenses can be purchased or otherwise acquired, for"
"the current item.",
)
thumbnailUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A thumbnail image relevant to the Thing.",
)
provider: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The service provider, service operator, or service performer; the goods producer."
"Another party (a seller) may offer those services or goods on behalf of the provider."
"A provider may also serve as the seller.",
)
expires: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="Date the content expires and is no longer useful or available. For example a [[VideoObject]]"
"or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]]"
"fact check whose publisher wants to indicate that it may no longer be relevant (or helpful"
"to highlight) after some date.",
)
contentLocation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The location depicted or described in the content. For example, the location in a photograph"
"or painting.",
)
educationalUse: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The purpose of a work in the context of education; for example, 'assignment', 'group"
"work'.",
)
copyrightHolder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The party holding the legal copyright to the CreativeWork.",
)
accessibilityControl: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Identifies input methods that are sufficient to fully control the described resource."
"Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).",
)
maintainer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other"
"[[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions"
"to, and/or publication of, some (typically complex) artifact. It is common for distributions"
'of software and data to be based on "upstream" sources. When [[maintainer]] is applied'
"to a specific version of something e.g. a particular version or packaging of a [[Dataset]],"
"it is always possible that the upstream source has a different maintainer. The [[isBasedOn]]"
"property can be used to indicate such relationships between datasets to make the different"
"maintenance roles clear. Similarly in the case of software, a package may have dedicated"
"maintainers working on integration into software distributions such as Ubuntu, as"
"well as upstream maintainers of the underlying work.",
)
educationalAlignment: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An alignment to an established educational framework.This property should not be used"
"where the nature of the alignment can be described using a simple property, for example"
"to express that a resource [[teaches]] or [[assesses]] a competency.",
)
spatial: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description='The "spatial" property can be used in cases when more specific properties(e.g. [[locationCreated]],'
"[[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.",
)
publisher: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The publisher of the creative work.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
assesses: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The item being described is intended to assess the competency or learning outcome defined"
"by the referenced term.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
isBasedOn: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A resource from which this work is derived or from which it is a modification or adaption.",
)
mentions: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates that the CreativeWork contains a reference to, but is not necessarily about"
"a concept.",
)
publishingPrinciples: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing"
"the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]]"
"writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity"
"policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles"
"are those of the party primarily responsible for the creation of the [[CreativeWork]].While"
"such policies are most typically expressed in natural language, sometimes related"
"information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.",
)
contributor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A secondary contributor to the CreativeWork or Event.",
)
license: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A license document that applies to this content, typically indicated by URL.",
)
citation: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A citation or reference to another creative work, such as another publication, web page,"
"scholarly article, etc.",
)
accessibilitySummary: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A human-readable summary of specific accessibility features or deficiencies, consistent"
'with the other accessibility metadata but expressing subtleties such as "short descriptions'
'are present but long descriptions will be needed for non-visual users" or "short descriptions'
'are present and no long descriptions are needed."',
)
award: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An award won by or for this item.",
)
commentCount: Optional[Union[List[Union[str, int, Any]], str, int, Any]] = Field(
default=None,
description="The number of comments this CreativeWork (e.g. Article, Question or Answer) has received."
"This is most applicable to works published in Web sites with commenting system; additional"
"comments may exist elsewhere.",
)
temporalCoverage: Union[
List[Union[datetime, str, Any, AnyUrl]], datetime, str, Any, AnyUrl
] = Field(
default=None,
description="The temporalCoverage of a CreativeWork indicates the period that the content applies"
"to, i.e. that it describes, either as a DateTime or as a textual string indicating a time"
"period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals)."
"In the case of a Dataset it will typically indicate the relevant time period in a precise"
'notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012").'
"Other forms of content, e.g. ScholarlyArticle, Book, TVSeries or TVEpisode, may indicate"
"their temporalCoverage in broader terms - textually or via well-known URL. Written"
"works such as books may sometimes have precise temporal coverage too, e.g. a work set"
'in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945".Open-ended'
'date ranges can be written with ".." in place of the end date. For example, "2015-11/.."'
"indicates a range beginning in November 2015 and with no specified final date. This is"
"tentative and might be updated in future when ISO 8601 is officially updated.",
)
dateCreated: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date on which the CreativeWork was created or the item was added to a DataFeed.",
)
discussionUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A link to the page containing the comments of the CreativeWork.",
)
copyrightNotice: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Text of a notice appropriate for describing the copyright aspects of this Creative Work,"
"ideally indicating the owner of the copyright for the Work.",
)
learningResourceType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The predominant type or kind characterizing the learning resource. For example, 'presentation',"
"'handout'.",
)
awards: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Awards won by or for this item.",
)
accessModeSufficient: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A list of single or combined accessModes that are sufficient to understand all the intellectual"
"content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
conditionsOfAccess: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Conditions that affect the availability of, or method(s) of access to, an item. Typically"
"used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]."
"This property is not suitable for use as a general Web access control mechanism. It is"
'expressed only in natural language.For example "Available by appointment from the'
'Reading Room" or "Accessible only from logged-in accounts ".',
)
interactivityType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The predominant mode of learning supported by the learning resource. Acceptable values"
"are 'active', 'expositive', or 'mixed'.",
)
abstract: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An abstract is a short description that summarizes a [[CreativeWork]].",
)
fileFormat: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml))"
"of the content, e.g. application/zip of a SoftwareApplication binary. In cases where"
"a CreativeWork has several media type representations, 'encoding' can be used to indicate"
"each MediaObject alongside particular fileFormat information. Unregistered or niche"
"file formats can be indicated instead via the most appropriate URL, e.g. defining Web"
"page or a Wikipedia entry.",
)
interpretedAsClaim: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Used to indicate a specific claim contained, implied, translated or refined from the"
"content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can"
"be indicated using [[claimInterpreter]].",
)
text: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The textual content of this CreativeWork.",
)
archivedAt: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case"
"of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible,"
"but be archived by archival, journalistic, activist, or law enforcement organizations."
"In such cases, the referenced page may not directly publish the content.",
)
alternativeHeadline: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A secondary title of the CreativeWork.",
)
creditText: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Text that can be used to credit person(s) and/or organization(s) associated with a published"
"Creative Work.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
interactionStatistic: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication."
"The most specific child type of InteractionCounter should be used.",
)
workExample: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Example/instance/realization/derivation of the concept of this creative work. E.g."
"the paperback edition, first edition, or e-book.",
)
about: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The subject matter of the content.",
)
encodings: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork.",
)
funder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports (sponsors) something through some kind of financial"
"contribution.",
)
video: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An embedded video object.",
)
isPartOf: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is"
"part of.",
)
pattern: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'."
"Values are typically expressed as text, although links to controlled value schemes"
"are also supported.",
)
editor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the Person who edited the CreativeWork.",
)
dateModified: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date on which the CreativeWork was most recently modified or when the item's entry"
"was modified within a DataFeed.",
)
translationOfWork: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The work that this work has been translated from. E.g. 物种起源 is a translationOf “On the"
"Origin of Species”.",
)
creativeWorkStatus: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The status of a creative work in terms of its stage in a lifecycle. Example terms include"
"Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for"
"the stages of their publication lifecycle.",
)
isBasedOnUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A resource that was used in the creation of this resource. This term can be repeated for"
"multiple sources. For example, http://example.com/great-multiplication-intro.html.",
)
isFamilyFriendly: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether this content is family friendly.",
)
isAccessibleForFree: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the item, event, or place is accessible for free.",
)
author: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The author of this content or rating. Please note that author is special in that HTML 5"
"provides a special mechanism for indicating authorship via the rel tag. That is equivalent"
"to this and may be used interchangeably.",
)
contentReferenceTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The specific time described by a creative work, for works (e.g. articles, video objects"
"etc.) that emphasise a particular moment within an Event.",
)
correction: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]],"
"textually or in another document.",
)
sdDatePublished: Optional[
Union[List[Union[str, Any, date]], str, Any, date]
] = Field(
default=None,
description="Indicates the date on which the current structured data was generated / published. Typically"
"used alongside [[sdPublisher]]",
)
comment: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Comments, typically from users.",
)
countryOfOrigin: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The country of origin of something, including products as well as creative works such"
"as movie and TV content.In the case of TV and movie, this would be the country of the principle"
"offices of the production company or individual responsible for the movie. For other"
"kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties"
"such as [[contentLocation]] and [[locationCreated]] may be more applicable.In the"
"case of products, the country of origin of the product. The exact interpretation of this"
"may vary by context and product type, and cannot be fully enumerated here.",
)
timeRequired: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Approximate or typical time it takes to work with or through this learning resource for"
"the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.",
)
typicalAgeRange: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The typical expected age range, e.g. '7-9', '11-'.",
)
genre: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Genre of the creative work, broadcast channel or group.",
)
producer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The person or organization who produced the work (e.g. music album, movie, TV/radio"
"series etc.).",
)
schemaVersion: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Indicates (by URL or string) a particular version of a schema used in some CreativeWork."
"This property was created primarily to indicate the use of a specific schema.org release,"
"e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```."
"There may be situations in which other schemas might usefully be referenced this way,"
"e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/```"
"but this has not been carefully explored in the community.",
)
audience: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An intended audience, i.e. a group for whom something was created.",
)
encoding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.",
)
publisherImprint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The publishing division which published the comic.",
)
accessibilityAPI: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Indicates that the resource is compatible with the referenced accessibility API. Values"
"should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).",
)
sdPublisher: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the party responsible for generating and publishing the current structured"
"data markup, typically in cases where the structured data is derived automatically"
"from existing published content but published on a different site. For example, student"
"projects and open data initiatives often re-publish existing content with more explicitly"
"structured metadata. The[[sdPublisher]] property helps make such practices more"
"explicit.",
)
audio: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An embedded audio object.",
)
accessibilityFeature: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Content features of the resource, such as accessible media, alternatives and supported"
"enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).",
)
spatialCoverage: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of"
"the content. It is a subproperty of contentLocation intended primarily for more technical"
"and detailed materials. For example with a Dataset, it indicates areas that the dataset"
"describes: a dataset of New York weather would have spatialCoverage which was the place:"
"the state of New York.",
)
accessMode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The human sensory perceptual system or cognitive faculty through which a person may"
"process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).",
)
editEIDR: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]]"
"representing a specific edit / edition for a work of film or television.For example,"
'the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J"'
'has several edits, e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3".Since'
"schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their"
"multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description),"
"or alongside [[editEIDR]] for a more edit-specific description.",
)
usageInfo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]."
"This property is applicable both to works that are freely available and to those that"
"require payment or other transactions. It can reference additional information, e.g."
"community expectations on preferred linking and citation conventions, as well as purchasing"
"details. For something that can be commercially licensed, usageInfo can provide detailed,"
"resource-specific information about licensing options.This property can be used"
"alongside the license property which indicates license(s) applicable to some piece"
"of content. The usageInfo property can provide information about other licensing options,"
"e.g. acquiring commercial usage rights for an image that is also available under non-commercial"
"creative commons licenses.",
)
position: Union[List[Union[str, int, Any]], str, int, Any] = Field(
default=None,
description="The position of an item in a series or sequence of items.",
)
encodingFormat: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)"
"and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)),"
"e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In"
"cases where a [[CreativeWork]] has several media type representations, [[encoding]]"
"can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]]"
"information.Unregistered or niche encoding and file formats can be indicated instead"
"via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.",
)
copyrightYear: Optional[
Union[
List[Union[str, Any, StrictInt, StrictFloat]],
str,
Any,
StrictInt,
StrictFloat,
]
] = Field(
default=None,
description="The year during which the claimed copyright for the CreativeWork was first asserted.",
)
mainEntity: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the primary entity described in some page or other CreativeWork.",
)
creator: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The creator/author of this CreativeWork. This is the same as the Author property for"
"CreativeWork.",
)
teaches: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The item being described is intended to help a person learn the competency or learning"
"outcome defined by the referenced term.",
)
temporal: Union[List[Union[datetime, str, Any]], datetime, str, Any] = Field(
default=None,
description='The "temporal" property can be used in cases where more specific properties(e.g.'
"[[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]])"
"are not known to be appropriate.",
)
size: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A standardized size of a product or creative work, specified either through a simple"
"textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode,"
"or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]],"
"[[height]], [[depth]] and [[weight]] properties may be more applicable.",
)
translator: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Organization or person who adapts a creative work to different languages, regional"
"differences and technical requirements of a target market, or that translates during"
"some event.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
accountablePerson: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the Person that is legally accountable for the CreativeWork.",
)
accessibilityHazard: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A characteristic of the described resource that is physiologically dangerous to some"
"users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).",
)
contentRating: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Official rating of a piece of content—for example, 'MPAA PG-13'.",
)
recordedAt: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The Event where the CreativeWork was recorded. The CreativeWork may capture all or part"
"of the event.",
)
publication: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A publication event associated with the item.",
)
sdLicense: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A license document that applies to this structured data, typically indicated by URL.",
)
headline: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Headline of the article.",
)
materialExtent: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The quantity of the materials being described or an expression of the physical space"
"they occupy.",
)
inLanguage: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The language of the content or performance or used in an action. Please use one of the language"
"codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also"
"[[availableLanguage]].",
)
material: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="A material that something is made from, e.g. leather, wool, cotton, paper.",
)
datePublished: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="Date of first broadcast/publication.",
)
offers: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An offer to provide this item—for example, an offer to sell a product, rent the"
"DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]"
"to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can"
"also be used to describe a [[Demand]]. While this property is listed as expected on a number"
"of common types, it can be used in others. In that case, using a second type, such as Product"
"or a subtype of Product, can clarify the nature of the offer.",
)
hasPart: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some"
"sense).",
)
sourceOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The Organization on whose behalf the creator was working.",
)
sponsor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports a thing through a pledge, promise, or financial"
"contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.",
)
character: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Fictional person connected with a creative work.",
)
inker: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The individual who traces over the pencil drawings in ink after pencils are complete.",
)
width: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The width of the item.",
)
letterer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The individual who adds lettering, including speech balloons and sound effects, to"
"artwork.",
)
depth: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The depth of the item.",
)
penciler: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The individual who draws the primary narrative artwork.",
)
artist: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The primary artist for a work in a medium other than pencils or digital line art--for example,"
"if the primary artwork is done in watercolors or digital paints.",
)
height: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The height of the item.",
)
colorist: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The individual who adds color to inked drawings.",
)
artMedium: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The material used. (E.g. Oil, Watercolour, Acrylic, Linoprint, Marble, Cyanotype,"
"Digital, Lithograph, DryPoint, Intaglio, Pastel, Woodcut, Pencil, Mixed Media, etc.)",
)
surface: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="A material used as a surface in some artwork, e.g. Canvas, Paper, Wood, Board, etc.",
)
artform: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="e.g. Painting, Drawing, Sculpture, Print, Photograph, Assemblage, Collage, etc.",
)
artEdition: Union[List[Union[str, int, Any]], str, int, Any] = Field(
default=None,
description="The number of copies when multiple copies of a piece of artwork are produced - e.g. for"
"a limited edition of 20 prints, 'artEdition' refers to the total number of copies (in"
'this example "20").',
)
artworkSurface: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The supporting materials for the artwork, e.g. Canvas, Paper, Wood, Board, etc.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/CoverArt.py
| 0.9298 | 0.328274 |
CoverArt.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class Plumber(BaseModel):
"""A plumbing service.
References:
https://schema.org/Plumber
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
serviceArea: (Optional[Union[List[Union[str, Any]], str, Any]]): The geographic area where the service is provided.
founder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person who founded this organization.
isicV4: (Union[List[Union[str, Any]], str, Any]): The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.
hasPOS: (Optional[Union[List[Union[str, Any]], str, Any]]): Points-of-Sales operated by the organization or person.
globalLocationNumber: (Union[List[Union[str, Any]], str, Any]): The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.
member: (Optional[Union[List[Union[str, Any]], str, Any]]): A member of an Organization or a ProgramMembership. Organizations can be members of organizations; ProgramMembership is typically for individuals.
knowsAbout: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that is known about - suggesting possible expertise but not implying it. We do not distinguish skill levels here, or relate this to educational content, events, objectives or [[JobPosting]] descriptions.
makesOffer: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to products or services offered by the organization or person.
ownershipFundingInfo: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a description of organizational ownership structure; funding and grants. In a news/media setting, this is with particular reference to editorial independence. Note that the [[funder]] is also available and can be used to make basic funder information machine-readable.
founders: (Optional[Union[List[Union[str, Any]], str, Any]]): A person who founded this organization.
legalName: (Union[List[Union[str, Any]], str, Any]): The official name of the organization, e.g. the registered company name.
actionableFeedbackPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement about public engagement activities (for news media, the newsroom’s), including involving the public - digitally or otherwise -- in coverage decisions, reporting and activities after publication.
areaServed: (Union[List[Union[str, Any]], str, Any]): The geographic area where a service or offered item is provided.
parentOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): The larger organization that this organization is a [[subOrganization]] of, if any.
slogan: (Union[List[Union[str, Any]], str, Any]): A slogan or motto associated with the item.
department: (Optional[Union[List[Union[str, Any]], str, Any]]): A relationship between an organization and a department of that organization, also described as an organization (allowing different urls, logos, opening hours). For example: a store with a pharmacy, or a bakery with a cafe.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
memberOf: (Optional[Union[List[Union[str, Any]], str, Any]]): An Organization (or ProgramMembership) to which this Person or Organization belongs.
publishingPrinciples: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]].While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.
employee: (Optional[Union[List[Union[str, Any]], str, Any]]): Someone working for this organization.
award: (Union[List[Union[str, Any]], str, Any]): An award won by or for this item.
email: (Union[List[Union[str, Any]], str, Any]): Email address.
contactPoints: (Optional[Union[List[Union[str, Any]], str, Any]]): A contact point for a person or organization.
diversityStaffingReport: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]), a report on staffing diversity issues. In a news context this might be for example ASNE or RTDNA (US) reports, or self-reported.
foundingDate: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): The date that this organization was founded.
owns: (Optional[Union[List[Union[str, Any]], str, Any]]): Products owned by the organization or person.
awards: (Union[List[Union[str, Any]], str, Any]): Awards won by or for this item.
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
dissolutionDate: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): The date that this organization was dissolved.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
interactionStatistic: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.
events: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past events associated with this place or organization.
seeks: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to products or services sought by the organization or person (demand).
employees: (Optional[Union[List[Union[str, Any]], str, Any]]): People working for this organization.
unnamedSourcesPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about policy on use of unnamed sources and the decision process required.
subOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): A relationship between two organizations where the first includes the second, e.g., as a subsidiary. See also: the more specific 'department' property.
foundingLocation: (Optional[Union[List[Union[str, Any]], str, Any]]): The place where the Organization was founded.
funder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports (sponsors) something through some kind of financial contribution.
iso6523Code: (Union[List[Union[str, Any]], str, Any]): An organization identifier as defined in ISO 6523(-1). Note that many existing organization identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns) and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier by setting the ICD part of the ISO 6523 identifier accordingly.
diversityPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]. For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity policy on both staffing and sources, typically providing staffing data.
hasMerchantReturnPolicy: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies a MerchantReturnPolicy that may be applicable.
event: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past event associated with this place, organization, or action.
duns: (Union[List[Union[str, Any]], str, Any]): The Dun & Bradstreet DUNS number for identifying an organization or business person.
alumni: (Optional[Union[List[Union[str, Any]], str, Any]]): Alumni of an organization.
ethicsPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic and publishing practices, or of a [[Restaurant]], a page describing food source policies. In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement describing the personal, organizational, and corporate standards of behavior expected by the organization.
leiCode: (Union[List[Union[str, Any]], str, Any]): An organization identifier that uniquely identifies a legal entity as defined in ISO 17442.
vatID: (Union[List[Union[str, Any]], str, Any]): The Value-added Tax ID of the organization or person.
knowsLanguage: (Union[List[Union[str, Any]], str, Any]): Of a [[Person]], and less typically of an [[Organization]], to indicate a known language. We do not distinguish skill levels or reading/writing/speaking/signing here. Use language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).
correctionsPolicy: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing (in news media, the newsroom’s) disclosure and correction policy for errors.
logo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An associated logo.
hasCredential: (Optional[Union[List[Union[str, Any]], str, Any]]): A credential awarded to the Person or Organization.
address: (Union[List[Union[str, Any]], str, Any]): Physical address of the item.
brand: (Optional[Union[List[Union[str, Any]], str, Any]]): The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.
nonprofitStatus: (Optional[Union[List[Union[str, Any]], str, Any]]): nonprofitStatus indicates the legal status of a non-profit organization in its primary place of business.
contactPoint: (Optional[Union[List[Union[str, Any]], str, Any]]): A contact point for a person or organization.
hasOfferCatalog: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates an OfferCatalog listing for this Organization, Person, or Service.
members: (Optional[Union[List[Union[str, Any]], str, Any]]): A member of this organization.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
faxNumber: (Union[List[Union[str, Any]], str, Any]): The fax number.
telephone: (Union[List[Union[str, Any]], str, Any]): The telephone number.
taxID: (Union[List[Union[str, Any]], str, Any]): The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in Spain.
naics: (Union[List[Union[str, Any]], str, Any]): The North American Industry Classification System (NAICS) code for a particular organization or business person.
location: (Union[List[Union[str, Any]], str, Any]): The location of, for example, where an event is happening, where an organization is located, or where an action takes place.
numberOfEmployees: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of employees in an organization, e.g. business.
sponsor: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
geoCovers: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a covering geometry to a covered geometry. "Every point of b is a point of (the interior or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
longitude: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).
smokingAllowed: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or hotel room.
isicV4: (Union[List[Union[str, Any]], str, Any]): The International Standard of Industrial Classification of All Economic Activities (ISIC), Revision 4 code for a particular organization, business person, or place.
globalLocationNumber: (Union[List[Union[str, Any]], str, Any]): The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred to as International Location Number or ILN) of the respective organization, person, or place. The GLN is a 13-digit number used to identify parties and physical locations.
amenityFeature: (Optional[Union[List[Union[str, Any]], str, Any]]): An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic property does not make a statement about whether the feature is included in an offer for the main accommodation or available at extra costs.
additionalProperty: (Optional[Union[List[Union[str, Any]], str, Any]]): A property-value pair representing an additional characteristic of the entity, e.g. a product feature or another characteristic for which there is no matching property in schema.org.Note: Publishers should be aware that applications designed to use specific schema.org properties (e.g. https://schema.org/width, https://schema.org/color, https://schema.org/gtin13, ...) will typically expect such data to be provided using those properties, rather than using the generic property/value mechanism.
slogan: (Union[List[Union[str, Any]], str, Any]): A slogan or motto associated with the item.
photos: (Optional[Union[List[Union[str, Any]], str, Any]]): Photographs of this place.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
tourBookingPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]] or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.
geoWithin: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
containsPlace: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and another that it contains.
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
hasMap: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
containedIn: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and one that contains it.
events: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past events associated with this place or organization.
geoOverlaps: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that geospatially overlaps it, i.e. they have some but not all points in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
geoEquals: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM). "Two geometries are topologically equal if their interiors intersect and no part of the interior or boundary of one geometry intersects the exterior of the other" (a symmetric relationship).
maps: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
isAccessibleForFree: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the item, event, or place is accessible for free.
event: (Optional[Union[List[Union[str, Any]], str, Any]]): Upcoming or past event associated with this place, organization, or action.
photo: (Optional[Union[List[Union[str, Any]], str, Any]]): A photograph of this place.
containedInPlace: (Optional[Union[List[Union[str, Any]], str, Any]]): The basic containment relation between a place and one that contains it.
logo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An associated logo.
geoCrosses: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that crosses it: "a crosses b: they have some but not all interior points in common, and the dimension of the intersection is less than that of at least one of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
address: (Union[List[Union[str, Any]], str, Any]): Physical address of the item.
geo: (Optional[Union[List[Union[str, Any]], str, Any]]): The geo coordinates of the place.
openingHoursSpecification: (Optional[Union[List[Union[str, Any]], str, Any]]): The opening hours of a certain place.
geoDisjoint: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) are topologically disjoint: "they have no point in common. They form a set of disconnected geometries." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)
geoIntersects: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
latitude: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).
maximumAttendeeCapacity: (Optional[Union[List[Union[str, int, Any]], str, int, Any]]): The total number of individuals that may attend an event or venue.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
map: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A URL to a map of the place.
branchCode: (Union[List[Union[str, Any]], str, Any]): A short textual code (also called "store code") that uniquely identifies a place of business. The code is typically assigned by the parentOrganization and used in structured URLs.For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047 the code "3047" is a branchCode for a particular branch.
faxNumber: (Union[List[Union[str, Any]], str, Any]): The fax number.
publicAccess: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the [[Place]] is open to public visitors. If this property is omitted there is no assumed default boolean value
geoTouches: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents spatial relations in which two geometries (or the places they represent) touch: "they have at least one boundary point in common, but no interior points." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)
geoCoveredBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
telephone: (Union[List[Union[str, Any]], str, Any]): The telephone number.
hasDriveThroughService: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]]) offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]] such facilities could potentially help with social distancing from other potentially-infected users.
specialOpeningHoursSpecification: (Optional[Union[List[Union[str, Any]], str, Any]]): The special opening hours of a certain place.Use this to explicitly override general opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]].
geoContains: (Optional[Union[List[Union[str, Any]], str, Any]]): Represents a relationship between two geometries (or the places they represent), relating a containing geometry to a contained geometry. "a contains b iff no points of b lie in the exterior of a, and at least one point of the interior of b lies in the interior of a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).
priceRange: (Union[List[Union[str, Any]], str, Any]): The price range of the business, for example ```$$$```.
currenciesAccepted: (Union[List[Union[str, Any]], str, Any]): The currency accepted.Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217), e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies) for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system) (LETS) and other currency types, e.g. "Ithaca HOUR".
branchOf: (Optional[Union[List[Union[str, Any]], str, Any]]): The larger organization that this local business is a branch of, if any. Not to be confused with (anatomical) [[branch]].
paymentAccepted: (Union[List[Union[str, Any]], str, Any]): Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.
openingHours: (Union[List[Union[str, Any]], str, Any]): The general opening hours for a business. Opening hours can be specified as a weekly time range, starting with days, then times per day. Multiple days can be listed with commas ',' separating each day. Day or time ranges are specified using a hyphen '-'.* Days are specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```, ```Th```, ```Fr```, ```Sa```, ```Su```.* Times are specified using 24:00 format. For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example: <code><time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays and Thursdays 4-8pm</time></code>.* If a business is open 7 days a week, then it can be specified as <code><time itemprop="openingHours" datetime="Mo-Su">Monday through Sunday, all day</time></code>.
"""
type_: str = Field(default="Plumber", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
serviceArea: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The geographic area where the service is provided.",
)
founder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person who founded this organization.",
)
isicV4: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The International Standard of Industrial Classification of All Economic Activities"
"(ISIC), Revision 4 code for a particular organization, business person, or place.",
)
hasPOS: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Points-of-Sales operated by the organization or person.",
)
globalLocationNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred"
"to as International Location Number or ILN) of the respective organization, person,"
"or place. The GLN is a 13-digit number used to identify parties and physical locations.",
)
member: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A member of an Organization or a ProgramMembership. Organizations can be members of"
"organizations; ProgramMembership is typically for individuals.",
)
knowsAbout: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that"
"is known about - suggesting possible expertise but not implying it. We do not distinguish"
"skill levels here, or relate this to educational content, events, objectives or [[JobPosting]]"
"descriptions.",
)
makesOffer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to products or services offered by the organization or person.",
)
ownershipFundingInfo: Union[
List[Union[str, AnyUrl, Any]], str, AnyUrl, Any
] = Field(
default=None,
description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]),"
"a description of organizational ownership structure; funding and grants. In a news/media"
"setting, this is with particular reference to editorial independence. Note that the"
"[[funder]] is also available and can be used to make basic funder information machine-readable.",
)
founders: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person who founded this organization.",
)
legalName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The official name of the organization, e.g. the registered company name.",
)
actionableFeedbackPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement"
"about public engagement activities (for news media, the newsroom’s), including involving"
"the public - digitally or otherwise -- in coverage decisions, reporting and activities"
"after publication.",
)
areaServed: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The geographic area where a service or offered item is provided.",
)
parentOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The larger organization that this organization is a [[subOrganization]] of, if any.",
)
slogan: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A slogan or motto associated with the item.",
)
department: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A relationship between an organization and a department of that organization, also"
"described as an organization (allowing different urls, logos, opening hours). For"
"example: a store with a pharmacy, or a bakery with a cafe.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
memberOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An Organization (or ProgramMembership) to which this Person or Organization belongs.",
)
publishingPrinciples: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing"
"the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]]"
"writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity"
"policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles"
"are those of the party primarily responsible for the creation of the [[CreativeWork]].While"
"such policies are most typically expressed in natural language, sometimes related"
"information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.",
)
employee: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Someone working for this organization.",
)
award: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An award won by or for this item.",
)
email: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Email address.",
)
contactPoints: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A contact point for a person or organization.",
)
diversityStaffingReport: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]]),"
"a report on staffing diversity issues. In a news context this might be for example ASNE"
"or RTDNA (US) reports, or self-reported.",
)
foundingDate: Optional[Union[List[Union[str, Any, date]], str, Any, date]] = Field(
default=None,
description="The date that this organization was founded.",
)
owns: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Products owned by the organization or person.",
)
awards: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Awards won by or for this item.",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
dissolutionDate: Optional[
Union[List[Union[str, Any, date]], str, Any, date]
] = Field(
default=None,
description="The date that this organization was dissolved.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
interactionStatistic: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication."
"The most specific child type of InteractionCounter should be used.",
)
events: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past events associated with this place or organization.",
)
seeks: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to products or services sought by the organization or person (demand).",
)
employees: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="People working for this organization.",
)
unnamedSourcesPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about"
"policy on use of unnamed sources and the decision process required.",
)
subOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A relationship between two organizations where the first includes the second, e.g.,"
"as a subsidiary. See also: the more specific 'department' property.",
)
foundingLocation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The place where the Organization was founded.",
)
funder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports (sponsors) something through some kind of financial"
"contribution.",
)
iso6523Code: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An organization identifier as defined in ISO 6523(-1). Note that many existing organization"
"identifiers such as [leiCode](https://schema.org/leiCode), [duns](https://schema.org/duns)"
"and [vatID](https://schema.org/vatID) can be expressed as an ISO 6523 identifier"
"by setting the ICD part of the ISO 6523 identifier accordingly.",
)
diversityPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]."
"For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity"
"policy on both staffing and sources, typically providing staffing data.",
)
hasMerchantReturnPolicy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies a MerchantReturnPolicy that may be applicable.",
)
event: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past event associated with this place, organization, or action.",
)
duns: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Dun & Bradstreet DUNS number for identifying an organization or business person.",
)
alumni: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Alumni of an organization.",
)
ethicsPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic"
"and publishing practices, or of a [[Restaurant]], a page describing food source policies."
"In the case of a [[NewsMediaOrganization]], an ethicsPolicy is typically a statement"
"describing the personal, organizational, and corporate standards of behavior expected"
"by the organization.",
)
leiCode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An organization identifier that uniquely identifies a legal entity as defined in ISO"
"17442.",
)
vatID: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Value-added Tax ID of the organization or person.",
)
knowsLanguage: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Of a [[Person]], and less typically of an [[Organization]], to indicate a known language."
"We do not distinguish skill levels or reading/writing/speaking/signing here. Use"
"language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).",
)
correctionsPolicy: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing"
"(in news media, the newsroom’s) disclosure and correction policy for errors.",
)
logo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An associated logo.",
)
hasCredential: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A credential awarded to the Person or Organization.",
)
address: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Physical address of the item.",
)
brand: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The brand(s) associated with a product or service, or the brand(s) maintained by an organization"
"or business person.",
)
nonprofitStatus: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="nonprofitStatus indicates the legal status of a non-profit organization in its primary"
"place of business.",
)
contactPoint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A contact point for a person or organization.",
)
hasOfferCatalog: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates an OfferCatalog listing for this Organization, Person, or Service.",
)
members: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A member of this organization.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
faxNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The fax number.",
)
telephone: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The telephone number.",
)
taxID: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in"
"Spain.",
)
naics: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The North American Industry Classification System (NAICS) code for a particular organization"
"or business person.",
)
location: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The location of, for example, where an event is happening, where an organization is located,"
"or where an action takes place.",
)
numberOfEmployees: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of employees in an organization, e.g. business.",
)
sponsor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports a thing through a pledge, promise, or financial"
"contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.",
)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
geoCovers: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a covering geometry to a covered geometry. "Every point of b is a point of (the interior'
'or boundary of) a". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).',
)
longitude: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).",
)
smokingAllowed: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or"
"hotel room.",
)
isicV4: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The International Standard of Industrial Classification of All Economic Activities"
"(ISIC), Revision 4 code for a particular organization, business person, or place.",
)
globalLocationNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The [Global Location Number](http://www.gs1.org/gln) (GLN, sometimes also referred"
"to as International Location Number or ILN) of the respective organization, person,"
"or place. The GLN is a 13-digit number used to identify parties and physical locations.",
)
amenityFeature: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic"
"property does not make a statement about whether the feature is included in an offer for"
"the main accommodation or available at extra costs.",
)
additionalProperty: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A property-value pair representing an additional characteristic of the entity, e.g."
"a product feature or another characteristic for which there is no matching property"
"in schema.org.Note: Publishers should be aware that applications designed to use specific"
"schema.org properties (e.g. https://schema.org/width, https://schema.org/color,"
"https://schema.org/gtin13, ...) will typically expect such data to be provided using"
"those properties, rather than using the generic property/value mechanism.",
)
slogan: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A slogan or motto associated with the item.",
)
photos: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Photographs of this place.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
tourBookingPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]]"
"or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.",
)
geoWithin: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined"
"in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
containsPlace: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and another that it contains.",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
hasMap: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
containedIn: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and one that contains it.",
)
events: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past events associated with this place or organization.",
)
geoOverlaps: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to another that geospatially overlaps it, i.e. they have some but not all points"
"in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
geoEquals: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
"are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM)."
'"Two geometries are topologically equal if their interiors intersect and no part of'
'the interior or boundary of one geometry intersects the exterior of the other" (a symmetric'
"relationship).",
)
maps: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
isAccessibleForFree: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the item, event, or place is accessible for free.",
)
event: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Upcoming or past event associated with this place, organization, or action.",
)
photo: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A photograph of this place.",
)
containedInPlace: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The basic containment relation between a place and one that contains it.",
)
logo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An associated logo.",
)
geoCrosses: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a geometry to another that crosses it: "a crosses b: they have some but not all interior'
"points in common, and the dimension of the intersection is less than that of at least one"
'of them". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).',
)
address: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Physical address of the item.",
)
geo: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The geo coordinates of the place.",
)
openingHoursSpecification: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The opening hours of a certain place.",
)
geoDisjoint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
'are topologically disjoint: "they have no point in common. They form a set of disconnected'
'geometries." (A symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)',
)
geoIntersects: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
"have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
latitude: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).",
)
maximumAttendeeCapacity: Optional[
Union[List[Union[str, int, Any]], str, int, Any]
] = Field(
default=None,
description="The total number of individuals that may attend an event or venue.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
map: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A URL to a map of the place.",
)
branchCode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description='A short textual code (also called "store code") that uniquely identifies a place of'
"business. The code is typically assigned by the parentOrganization and used in structured"
"URLs.For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047"
'the code "3047" is a branchCode for a particular branch.',
)
faxNumber: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The fax number.",
)
publicAccess: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the [[Place]] is open to public visitors. If this property is omitted"
"there is no assumed default boolean value",
)
geoTouches: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents spatial relations in which two geometries (or the places they represent)"
'touch: "they have at least one boundary point in common, but no interior points." (A'
"symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).)",
)
geoCoveredBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
"a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
telephone: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The telephone number.",
)
hasDriveThroughService: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]])"
"offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]]"
"such facilities could potentially help with social distancing from other potentially-infected"
"users.",
)
specialOpeningHoursSpecification: Optional[
Union[List[Union[str, Any]], str, Any]
] = Field(
default=None,
description="The special opening hours of a certain place.Use this to explicitly override general"
"opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]].",
)
geoContains: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Represents a relationship between two geometries (or the places they represent), relating"
'a containing geometry to a contained geometry. "a contains b iff no points of b lie in'
'the exterior of a, and at least one point of the interior of b lies in the interior of a".'
"As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).",
)
priceRange: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The price range of the business, for example ```$$$```.",
)
currenciesAccepted: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The currency accepted.Use standard formats: [ISO 4217 currency format](http://en.wikipedia.org/wiki/ISO_4217),"
'e.g. "USD"; [Ticker symbol](https://en.wikipedia.org/wiki/List_of_cryptocurrencies)'
'for cryptocurrencies, e.g. "BTC"; well known names for [Local Exchange Trading Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system)'
'(LETS) and other currency types, e.g. "Ithaca HOUR".',
)
branchOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The larger organization that this local business is a branch of, if any. Not to be confused"
"with (anatomical) [[branch]].",
)
paymentAccepted: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Cash, Credit Card, Cryptocurrency, Local Exchange Tradings System, etc.",
)
openingHours: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The general opening hours for a business. Opening hours can be specified as a weekly time"
"range, starting with days, then times per day. Multiple days can be listed with commas"
"',' separating each day. Day or time ranges are specified using a hyphen '-'.* Days are"
"specified using the following two-letter combinations: ```Mo```, ```Tu```, ```We```,"
"```Th```, ```Fr```, ```Sa```, ```Su```.* Times are specified using 24:00 format."
"For example, 3pm is specified as ```15:00```, 10am as ```10:00```. * Here is an example:"
'<code><time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays'
"and Thursdays 4-8pm</time></code>.* If a business is open 7 days a week, then"
"it can be specified as <code><time itemprop="openingHours" datetime="Mo-Su">Monday"
"through Sunday, all day</time></code>.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/Plumber.py
| 0.88316 | 0.337204 |
Plumber.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class MRI(BaseModel):
"""Magnetic resonance imaging.
References:
https://schema.org/MRI
Note:
Model Depth 6
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
supersededBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Relates a term (i.e. a property, class or enumeration) to one that supersedes it.
"""
type_: str = Field(default="MRI", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
supersededBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/MRI.py
| 0.936699 | 0.323527 |
MRI.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class EducationalAudience(BaseModel):
"""An EducationalAudience.
References:
https://schema.org/EducationalAudience
Note:
Model Depth 4
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
audienceType: (Union[List[Union[str, Any]], str, Any]): The target group associated with a given audience (e.g. veterans, car owners, musicians, etc.).
geographicArea: (Optional[Union[List[Union[str, Any]], str, Any]]): The geographic area associated with the audience.
educationalRole: (Union[List[Union[str, Any]], str, Any]): An educationalRole of an EducationalAudience.
"""
type_: str = Field(default="EducationalAudience", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
audienceType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The target group associated with a given audience (e.g. veterans, car owners, musicians,"
"etc.).",
)
geographicArea: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The geographic area associated with the audience.",
)
educationalRole: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An educationalRole of an EducationalAudience.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/EducationalAudience.py
| 0.939644 | 0.324797 |
EducationalAudience.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class GovernmentService(BaseModel):
"""A service provided by a government organization, e.g. food stamps, veterans benefits, etc.
References:
https://schema.org/GovernmentService
Note:
Model Depth 4
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
serviceArea: (Optional[Union[List[Union[str, Any]], str, Any]]): The geographic area where the service is provided.
broker: (Optional[Union[List[Union[str, Any]], str, Any]]): An entity that arranges for an exchange between a buyer and a seller. In most cases a broker never acquires or releases ownership of a product or service involved in an exchange. If it is not clear whether an entity is a broker, seller, or buyer, the latter two terms are preferred.
provider: (Optional[Union[List[Union[str, Any]], str, Any]]): The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller.
areaServed: (Union[List[Union[str, Any]], str, Any]): The geographic area where a service or offered item is provided.
slogan: (Union[List[Union[str, Any]], str, Any]): A slogan or motto associated with the item.
award: (Union[List[Union[str, Any]], str, Any]): An award won by or for this item.
termsOfService: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Human-readable terms of service documentation.
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
availableChannel: (Optional[Union[List[Union[str, Any]], str, Any]]): A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).
isRelatedTo: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to another, somehow related product (or multiple products).
serviceAudience: (Optional[Union[List[Union[str, Any]], str, Any]]): The audience eligible for this service.
isSimilarTo: (Optional[Union[List[Union[str, Any]], str, Any]]): A pointer to another, functionally similar product (or multiple products).
audience: (Optional[Union[List[Union[str, Any]], str, Any]]): An intended audience, i.e. a group for whom something was created.
logo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An associated logo.
providerMobility: (Union[List[Union[str, Any]], str, Any]): Indicates the mobility of a provided service (e.g. 'static', 'dynamic').
hoursAvailable: (Optional[Union[List[Union[str, Any]], str, Any]]): The hours during which this service or contact is available.
brand: (Optional[Union[List[Union[str, Any]], str, Any]]): The brand(s) associated with a product or service, or the brand(s) maintained by an organization or business person.
serviceOutput: (Optional[Union[List[Union[str, Any]], str, Any]]): The tangible thing generated by the service, e.g. a passport, permit, etc.
produces: (Optional[Union[List[Union[str, Any]], str, Any]]): The tangible thing generated by the service, e.g. a passport, permit, etc.
hasOfferCatalog: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates an OfferCatalog listing for this Organization, Person, or Service.
category: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
serviceType: (Union[List[Union[str, Any]], str, Any]): The type of service being offered, e.g. veterans' benefits, emergency relief, etc.
offers: (Optional[Union[List[Union[str, Any]], str, Any]]): An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]] to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can also be used to describe a [[Demand]]. While this property is listed as expected on a number of common types, it can be used in others. In that case, using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.
serviceOperator: (Optional[Union[List[Union[str, Any]], str, Any]]): The operating organization, if different from the provider. This enables the representation of services that are provided by an organization, but operated by another organization like a subcontractor.
jurisdiction: (Union[List[Union[str, Any]], str, Any]): Indicates a legal jurisdiction, e.g. of some legislation, or where some government service is based.
"""
type_: str = Field(default="GovernmentService", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
serviceArea: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The geographic area where the service is provided.",
)
broker: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An entity that arranges for an exchange between a buyer and a seller. In most cases a broker"
"never acquires or releases ownership of a product or service involved in an exchange."
"If it is not clear whether an entity is a broker, seller, or buyer, the latter two terms"
"are preferred.",
)
provider: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The service provider, service operator, or service performer; the goods producer."
"Another party (a seller) may offer those services or goods on behalf of the provider."
"A provider may also serve as the seller.",
)
areaServed: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The geographic area where a service or offered item is provided.",
)
slogan: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A slogan or motto associated with the item.",
)
award: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An award won by or for this item.",
)
termsOfService: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Human-readable terms of service documentation.",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
availableChannel: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).",
)
isRelatedTo: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to another, somehow related product (or multiple products).",
)
serviceAudience: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The audience eligible for this service.",
)
isSimilarTo: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A pointer to another, functionally similar product (or multiple products).",
)
audience: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An intended audience, i.e. a group for whom something was created.",
)
logo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An associated logo.",
)
providerMobility: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Indicates the mobility of a provided service (e.g. 'static', 'dynamic').",
)
hoursAvailable: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The hours during which this service or contact is available.",
)
brand: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The brand(s) associated with a product or service, or the brand(s) maintained by an organization"
"or business person.",
)
serviceOutput: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The tangible thing generated by the service, e.g. a passport, permit, etc.",
)
produces: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The tangible thing generated by the service, e.g. a passport, permit, etc.",
)
hasOfferCatalog: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates an OfferCatalog listing for this Organization, Person, or Service.",
)
category: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="A category for the item. Greater signs or slashes can be used to informally indicate a"
"category hierarchy.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
serviceType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The type of service being offered, e.g. veterans' benefits, emergency relief, etc.",
)
offers: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An offer to provide this item—for example, an offer to sell a product, rent the"
"DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]"
"to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can"
"also be used to describe a [[Demand]]. While this property is listed as expected on a number"
"of common types, it can be used in others. In that case, using a second type, such as Product"
"or a subtype of Product, can clarify the nature of the offer.",
)
serviceOperator: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The operating organization, if different from the provider. This enables the representation"
"of services that are provided by an organization, but operated by another organization"
"like a subcontractor.",
)
jurisdiction: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Indicates a legal jurisdiction, e.g. of some legislation, or where some government"
"service is based.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/GovernmentService.py
| 0.865636 | 0.323273 |
GovernmentService.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class MediaReviewItem(BaseModel):
"""Represents an item or group of closely related items treated as a unit for the sake of evaluation in a [[MediaReview]]. Authorship etc. apply to the items rather than to the curation/grouping or reviewing party.
References:
https://schema.org/MediaReviewItem
Note:
Model Depth 3
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
workTranslation: (Optional[Union[List[Union[str, Any]], str, Any]]): A work that is a translation of the content of this work. E.g. 西遊記 has an English workTranslation “Journey to the West”, a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.
educationalLevel: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The level in terms of progression through an educational or training context. Examples of educational levels include 'beginner', 'intermediate' or 'advanced', and formal sets of level indicators.
associatedMedia: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork. This property is a synonym for encoding.
exampleOfWork: (Optional[Union[List[Union[str, Any]], str, Any]]): A creative work that this work is an example/instance/realization/derivation of.
releasedEvent: (Optional[Union[List[Union[str, Any]], str, Any]]): The place and time the release was issued, expressed as a PublicationEvent.
version: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The version of the CreativeWork embodied by a specified resource.
locationCreated: (Optional[Union[List[Union[str, Any]], str, Any]]): The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.
acquireLicensePage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.
thumbnailUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A thumbnail image relevant to the Thing.
provider: (Optional[Union[List[Union[str, Any]], str, Any]]): The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller.
expires: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.
contentLocation: (Optional[Union[List[Union[str, Any]], str, Any]]): The location depicted or described in the content. For example, the location in a photograph or painting.
educationalUse: (Union[List[Union[str, Any]], str, Any]): The purpose of a work in the context of education; for example, 'assignment', 'group work'.
copyrightHolder: (Optional[Union[List[Union[str, Any]], str, Any]]): The party holding the legal copyright to the CreativeWork.
accessibilityControl: (Union[List[Union[str, Any]], str, Any]): Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).
maintainer: (Optional[Union[List[Union[str, Any]], str, Any]]): A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.
educationalAlignment: (Optional[Union[List[Union[str, Any]], str, Any]]): An alignment to an established educational framework.This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.
spatial: (Optional[Union[List[Union[str, Any]], str, Any]]): The "spatial" property can be used in cases when more specific properties(e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.
publisher: (Optional[Union[List[Union[str, Any]], str, Any]]): The publisher of the creative work.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
assesses: (Union[List[Union[str, Any]], str, Any]): The item being described is intended to assess the competency or learning outcome defined by the referenced term.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
isBasedOn: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A resource from which this work is derived or from which it is a modification or adaption.
mentions: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.
publishingPrinciples: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]].While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.
contributor: (Optional[Union[List[Union[str, Any]], str, Any]]): A secondary contributor to the CreativeWork or Event.
license: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A license document that applies to this content, typically indicated by URL.
citation: (Union[List[Union[str, Any]], str, Any]): A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.
accessibilitySummary: (Union[List[Union[str, Any]], str, Any]): A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."
award: (Union[List[Union[str, Any]], str, Any]): An award won by or for this item.
commentCount: (Optional[Union[List[Union[str, int, Any]], str, int, Any]]): The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.
temporalCoverage: (Union[List[Union[datetime, str, Any, AnyUrl]], datetime, str, Any, AnyUrl]): The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content, e.g. ScholarlyArticle, Book, TVSeries or TVEpisode, may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945".Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.
dateCreated: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date on which the CreativeWork was created or the item was added to a DataFeed.
discussionUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A link to the page containing the comments of the CreativeWork.
copyrightNotice: (Union[List[Union[str, Any]], str, Any]): Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.
learningResourceType: (Union[List[Union[str, Any]], str, Any]): The predominant type or kind characterizing the learning resource. For example, 'presentation', 'handout'.
awards: (Union[List[Union[str, Any]], str, Any]): Awards won by or for this item.
accessModeSufficient: (Optional[Union[List[Union[str, Any]], str, Any]]): A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
conditionsOfAccess: (Union[List[Union[str, Any]], str, Any]): Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language.For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".
interactivityType: (Union[List[Union[str, Any]], str, Any]): The predominant mode of learning supported by the learning resource. Acceptable values are 'active', 'expositive', or 'mixed'.
abstract: (Union[List[Union[str, Any]], str, Any]): An abstract is a short description that summarizes a [[CreativeWork]].
fileFormat: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content, e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, 'encoding' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.
interpretedAsClaim: (Optional[Union[List[Union[str, Any]], str, Any]]): Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].
text: (Union[List[Union[str, Any]], str, Any]): The textual content of this CreativeWork.
archivedAt: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.
alternativeHeadline: (Union[List[Union[str, Any]], str, Any]): A secondary title of the CreativeWork.
creditText: (Union[List[Union[str, Any]], str, Any]): Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
interactionStatistic: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.
workExample: (Optional[Union[List[Union[str, Any]], str, Any]]): Example/instance/realization/derivation of the concept of this creative work. E.g. the paperback edition, first edition, or e-book.
about: (Optional[Union[List[Union[str, Any]], str, Any]]): The subject matter of the content.
encodings: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork.
funder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports (sponsors) something through some kind of financial contribution.
video: (Optional[Union[List[Union[str, Any]], str, Any]]): An embedded video object.
isPartOf: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.
pattern: (Union[List[Union[str, Any]], str, Any]): A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'. Values are typically expressed as text, although links to controlled value schemes are also supported.
editor: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the Person who edited the CreativeWork.
dateModified: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date on which the CreativeWork was most recently modified or when the item's entry was modified within a DataFeed.
translationOfWork: (Optional[Union[List[Union[str, Any]], str, Any]]): The work that this work has been translated from. E.g. 物种起源 is a translationOf “On the Origin of Species”.
creativeWorkStatus: (Union[List[Union[str, Any]], str, Any]): The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.
isBasedOnUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.
isFamilyFriendly: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether this content is family friendly.
isAccessibleForFree: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the item, event, or place is accessible for free.
author: (Optional[Union[List[Union[str, Any]], str, Any]]): The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.
contentReferenceTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.
correction: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.
sdDatePublished: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]
comment: (Optional[Union[List[Union[str, Any]], str, Any]]): Comments, typically from users.
countryOfOrigin: (Optional[Union[List[Union[str, Any]], str, Any]]): The country of origin of something, including products as well as creative works such as movie and TV content.In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable.In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.
timeRequired: (Optional[Union[List[Union[str, Any]], str, Any]]): Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.
typicalAgeRange: (Union[List[Union[str, Any]], str, Any]): The typical expected age range, e.g. '7-9', '11-'.
genre: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Genre of the creative work, broadcast channel or group.
producer: (Optional[Union[List[Union[str, Any]], str, Any]]): The person or organization who produced the work (e.g. music album, movie, TV/radio series etc.).
schemaVersion: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.
audience: (Optional[Union[List[Union[str, Any]], str, Any]]): An intended audience, i.e. a group for whom something was created.
encoding: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.
publisherImprint: (Optional[Union[List[Union[str, Any]], str, Any]]): The publishing division which published the comic.
accessibilityAPI: (Union[List[Union[str, Any]], str, Any]): Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).
sdPublisher: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The[[sdPublisher]] property helps make such practices more explicit.
audio: (Optional[Union[List[Union[str, Any]], str, Any]]): An embedded audio object.
accessibilityFeature: (Union[List[Union[str, Any]], str, Any]): Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).
spatialCoverage: (Optional[Union[List[Union[str, Any]], str, Any]]): The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.
accessMode: (Union[List[Union[str, Any]], str, Any]): The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).
editEIDR: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television.For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J" has several edits, e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3".Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description.
usageInfo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information, e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options.This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.
position: (Union[List[Union[str, int, Any]], str, int, Any]): The position of an item in a series or sequence of items.
encodingFormat: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)), e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information.Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.
copyrightYear: (Optional[Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]]): The year during which the claimed copyright for the CreativeWork was first asserted.
mainEntity: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the primary entity described in some page or other CreativeWork.
creator: (Optional[Union[List[Union[str, Any]], str, Any]]): The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.
teaches: (Union[List[Union[str, Any]], str, Any]): The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.
temporal: (Union[List[Union[datetime, str, Any]], datetime, str, Any]): The "temporal" property can be used in cases where more specific properties(e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.
size: (Union[List[Union[str, Any]], str, Any]): A standardized size of a product or creative work, specified either through a simple textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable.
translator: (Optional[Union[List[Union[str, Any]], str, Any]]): Organization or person who adapts a creative work to different languages, regional differences and technical requirements of a target market, or that translates during some event.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
accountablePerson: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the Person that is legally accountable for the CreativeWork.
accessibilityHazard: (Union[List[Union[str, Any]], str, Any]): A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).
contentRating: (Union[List[Union[str, Any]], str, Any]): Official rating of a piece of content—for example, 'MPAA PG-13'.
recordedAt: (Optional[Union[List[Union[str, Any]], str, Any]]): The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.
publication: (Optional[Union[List[Union[str, Any]], str, Any]]): A publication event associated with the item.
sdLicense: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A license document that applies to this structured data, typically indicated by URL.
headline: (Union[List[Union[str, Any]], str, Any]): Headline of the article.
materialExtent: (Union[List[Union[str, Any]], str, Any]): The quantity of the materials being described or an expression of the physical space they occupy.
inLanguage: (Union[List[Union[str, Any]], str, Any]): The language of the content or performance or used in an action. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[availableLanguage]].
material: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): A material that something is made from, e.g. leather, wool, cotton, paper.
datePublished: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): Date of first broadcast/publication.
offers: (Optional[Union[List[Union[str, Any]], str, Any]]): An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]] to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can also be used to describe a [[Demand]]. While this property is listed as expected on a number of common types, it can be used in others. In that case, using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.
hasPart: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).
sourceOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): The Organization on whose behalf the creator was working.
sponsor: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.
character: (Optional[Union[List[Union[str, Any]], str, Any]]): Fictional person connected with a creative work.
mediaItemAppearance: (Optional[Union[List[Union[str, Any]], str, Any]]): In the context of a [[MediaReview]], indicates specific media item(s) that are grouped using a [[MediaReviewItem]].
"""
type_: str = Field(default="MediaReviewItem", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
workTranslation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A work that is a translation of the content of this work. E.g. 西遊記 has an English workTranslation"
"“Journey to the West”, a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese"
"translation Tây du ký bình khảo.",
)
educationalLevel: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The level in terms of progression through an educational or training context. Examples"
"of educational levels include 'beginner', 'intermediate' or 'advanced', and formal"
"sets of level indicators.",
)
associatedMedia: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork. This property is a synonym for encoding.",
)
exampleOfWork: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A creative work that this work is an example/instance/realization/derivation of.",
)
releasedEvent: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The place and time the release was issued, expressed as a PublicationEvent.",
)
version: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The version of the CreativeWork embodied by a specified resource.",
)
locationCreated: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The location where the CreativeWork was created, which may not be the same as the location"
"depicted in the CreativeWork.",
)
acquireLicensePage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page documenting how licenses can be purchased or otherwise acquired, for"
"the current item.",
)
thumbnailUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A thumbnail image relevant to the Thing.",
)
provider: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The service provider, service operator, or service performer; the goods producer."
"Another party (a seller) may offer those services or goods on behalf of the provider."
"A provider may also serve as the seller.",
)
expires: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="Date the content expires and is no longer useful or available. For example a [[VideoObject]]"
"or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]]"
"fact check whose publisher wants to indicate that it may no longer be relevant (or helpful"
"to highlight) after some date.",
)
contentLocation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The location depicted or described in the content. For example, the location in a photograph"
"or painting.",
)
educationalUse: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The purpose of a work in the context of education; for example, 'assignment', 'group"
"work'.",
)
copyrightHolder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The party holding the legal copyright to the CreativeWork.",
)
accessibilityControl: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Identifies input methods that are sufficient to fully control the described resource."
"Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).",
)
maintainer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other"
"[[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions"
"to, and/or publication of, some (typically complex) artifact. It is common for distributions"
'of software and data to be based on "upstream" sources. When [[maintainer]] is applied'
"to a specific version of something e.g. a particular version or packaging of a [[Dataset]],"
"it is always possible that the upstream source has a different maintainer. The [[isBasedOn]]"
"property can be used to indicate such relationships between datasets to make the different"
"maintenance roles clear. Similarly in the case of software, a package may have dedicated"
"maintainers working on integration into software distributions such as Ubuntu, as"
"well as upstream maintainers of the underlying work.",
)
educationalAlignment: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An alignment to an established educational framework.This property should not be used"
"where the nature of the alignment can be described using a simple property, for example"
"to express that a resource [[teaches]] or [[assesses]] a competency.",
)
spatial: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description='The "spatial" property can be used in cases when more specific properties(e.g. [[locationCreated]],'
"[[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.",
)
publisher: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The publisher of the creative work.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
assesses: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The item being described is intended to assess the competency or learning outcome defined"
"by the referenced term.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
isBasedOn: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A resource from which this work is derived or from which it is a modification or adaption.",
)
mentions: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates that the CreativeWork contains a reference to, but is not necessarily about"
"a concept.",
)
publishingPrinciples: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing"
"the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]]"
"writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity"
"policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles"
"are those of the party primarily responsible for the creation of the [[CreativeWork]].While"
"such policies are most typically expressed in natural language, sometimes related"
"information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.",
)
contributor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A secondary contributor to the CreativeWork or Event.",
)
license: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A license document that applies to this content, typically indicated by URL.",
)
citation: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A citation or reference to another creative work, such as another publication, web page,"
"scholarly article, etc.",
)
accessibilitySummary: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A human-readable summary of specific accessibility features or deficiencies, consistent"
'with the other accessibility metadata but expressing subtleties such as "short descriptions'
'are present but long descriptions will be needed for non-visual users" or "short descriptions'
'are present and no long descriptions are needed."',
)
award: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An award won by or for this item.",
)
commentCount: Optional[Union[List[Union[str, int, Any]], str, int, Any]] = Field(
default=None,
description="The number of comments this CreativeWork (e.g. Article, Question or Answer) has received."
"This is most applicable to works published in Web sites with commenting system; additional"
"comments may exist elsewhere.",
)
temporalCoverage: Union[
List[Union[datetime, str, Any, AnyUrl]], datetime, str, Any, AnyUrl
] = Field(
default=None,
description="The temporalCoverage of a CreativeWork indicates the period that the content applies"
"to, i.e. that it describes, either as a DateTime or as a textual string indicating a time"
"period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals)."
"In the case of a Dataset it will typically indicate the relevant time period in a precise"
'notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012").'
"Other forms of content, e.g. ScholarlyArticle, Book, TVSeries or TVEpisode, may indicate"
"their temporalCoverage in broader terms - textually or via well-known URL. Written"
"works such as books may sometimes have precise temporal coverage too, e.g. a work set"
'in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945".Open-ended'
'date ranges can be written with ".." in place of the end date. For example, "2015-11/.."'
"indicates a range beginning in November 2015 and with no specified final date. This is"
"tentative and might be updated in future when ISO 8601 is officially updated.",
)
dateCreated: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date on which the CreativeWork was created or the item was added to a DataFeed.",
)
discussionUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A link to the page containing the comments of the CreativeWork.",
)
copyrightNotice: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Text of a notice appropriate for describing the copyright aspects of this Creative Work,"
"ideally indicating the owner of the copyright for the Work.",
)
learningResourceType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The predominant type or kind characterizing the learning resource. For example, 'presentation',"
"'handout'.",
)
awards: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Awards won by or for this item.",
)
accessModeSufficient: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A list of single or combined accessModes that are sufficient to understand all the intellectual"
"content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
conditionsOfAccess: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Conditions that affect the availability of, or method(s) of access to, an item. Typically"
"used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]."
"This property is not suitable for use as a general Web access control mechanism. It is"
'expressed only in natural language.For example "Available by appointment from the'
'Reading Room" or "Accessible only from logged-in accounts ".',
)
interactivityType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The predominant mode of learning supported by the learning resource. Acceptable values"
"are 'active', 'expositive', or 'mixed'.",
)
abstract: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An abstract is a short description that summarizes a [[CreativeWork]].",
)
fileFormat: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml))"
"of the content, e.g. application/zip of a SoftwareApplication binary. In cases where"
"a CreativeWork has several media type representations, 'encoding' can be used to indicate"
"each MediaObject alongside particular fileFormat information. Unregistered or niche"
"file formats can be indicated instead via the most appropriate URL, e.g. defining Web"
"page or a Wikipedia entry.",
)
interpretedAsClaim: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Used to indicate a specific claim contained, implied, translated or refined from the"
"content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can"
"be indicated using [[claimInterpreter]].",
)
text: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The textual content of this CreativeWork.",
)
archivedAt: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case"
"of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible,"
"but be archived by archival, journalistic, activist, or law enforcement organizations."
"In such cases, the referenced page may not directly publish the content.",
)
alternativeHeadline: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A secondary title of the CreativeWork.",
)
creditText: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Text that can be used to credit person(s) and/or organization(s) associated with a published"
"Creative Work.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
interactionStatistic: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication."
"The most specific child type of InteractionCounter should be used.",
)
workExample: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Example/instance/realization/derivation of the concept of this creative work. E.g."
"the paperback edition, first edition, or e-book.",
)
about: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The subject matter of the content.",
)
encodings: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork.",
)
funder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports (sponsors) something through some kind of financial"
"contribution.",
)
video: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An embedded video object.",
)
isPartOf: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is"
"part of.",
)
pattern: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'."
"Values are typically expressed as text, although links to controlled value schemes"
"are also supported.",
)
editor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the Person who edited the CreativeWork.",
)
dateModified: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date on which the CreativeWork was most recently modified or when the item's entry"
"was modified within a DataFeed.",
)
translationOfWork: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The work that this work has been translated from. E.g. 物种起源 is a translationOf “On the"
"Origin of Species”.",
)
creativeWorkStatus: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The status of a creative work in terms of its stage in a lifecycle. Example terms include"
"Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for"
"the stages of their publication lifecycle.",
)
isBasedOnUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A resource that was used in the creation of this resource. This term can be repeated for"
"multiple sources. For example, http://example.com/great-multiplication-intro.html.",
)
isFamilyFriendly: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether this content is family friendly.",
)
isAccessibleForFree: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the item, event, or place is accessible for free.",
)
author: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The author of this content or rating. Please note that author is special in that HTML 5"
"provides a special mechanism for indicating authorship via the rel tag. That is equivalent"
"to this and may be used interchangeably.",
)
contentReferenceTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The specific time described by a creative work, for works (e.g. articles, video objects"
"etc.) that emphasise a particular moment within an Event.",
)
correction: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]],"
"textually or in another document.",
)
sdDatePublished: Optional[
Union[List[Union[str, Any, date]], str, Any, date]
] = Field(
default=None,
description="Indicates the date on which the current structured data was generated / published. Typically"
"used alongside [[sdPublisher]]",
)
comment: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Comments, typically from users.",
)
countryOfOrigin: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The country of origin of something, including products as well as creative works such"
"as movie and TV content.In the case of TV and movie, this would be the country of the principle"
"offices of the production company or individual responsible for the movie. For other"
"kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties"
"such as [[contentLocation]] and [[locationCreated]] may be more applicable.In the"
"case of products, the country of origin of the product. The exact interpretation of this"
"may vary by context and product type, and cannot be fully enumerated here.",
)
timeRequired: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Approximate or typical time it takes to work with or through this learning resource for"
"the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.",
)
typicalAgeRange: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The typical expected age range, e.g. '7-9', '11-'.",
)
genre: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Genre of the creative work, broadcast channel or group.",
)
producer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The person or organization who produced the work (e.g. music album, movie, TV/radio"
"series etc.).",
)
schemaVersion: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Indicates (by URL or string) a particular version of a schema used in some CreativeWork."
"This property was created primarily to indicate the use of a specific schema.org release,"
"e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```."
"There may be situations in which other schemas might usefully be referenced this way,"
"e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/```"
"but this has not been carefully explored in the community.",
)
audience: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An intended audience, i.e. a group for whom something was created.",
)
encoding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.",
)
publisherImprint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The publishing division which published the comic.",
)
accessibilityAPI: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Indicates that the resource is compatible with the referenced accessibility API. Values"
"should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).",
)
sdPublisher: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the party responsible for generating and publishing the current structured"
"data markup, typically in cases where the structured data is derived automatically"
"from existing published content but published on a different site. For example, student"
"projects and open data initiatives often re-publish existing content with more explicitly"
"structured metadata. The[[sdPublisher]] property helps make such practices more"
"explicit.",
)
audio: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An embedded audio object.",
)
accessibilityFeature: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Content features of the resource, such as accessible media, alternatives and supported"
"enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).",
)
spatialCoverage: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of"
"the content. It is a subproperty of contentLocation intended primarily for more technical"
"and detailed materials. For example with a Dataset, it indicates areas that the dataset"
"describes: a dataset of New York weather would have spatialCoverage which was the place:"
"the state of New York.",
)
accessMode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The human sensory perceptual system or cognitive faculty through which a person may"
"process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).",
)
editEIDR: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]]"
"representing a specific edit / edition for a work of film or television.For example,"
'the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J"'
'has several edits, e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3".Since'
"schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their"
"multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description),"
"or alongside [[editEIDR]] for a more edit-specific description.",
)
usageInfo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]."
"This property is applicable both to works that are freely available and to those that"
"require payment or other transactions. It can reference additional information, e.g."
"community expectations on preferred linking and citation conventions, as well as purchasing"
"details. For something that can be commercially licensed, usageInfo can provide detailed,"
"resource-specific information about licensing options.This property can be used"
"alongside the license property which indicates license(s) applicable to some piece"
"of content. The usageInfo property can provide information about other licensing options,"
"e.g. acquiring commercial usage rights for an image that is also available under non-commercial"
"creative commons licenses.",
)
position: Union[List[Union[str, int, Any]], str, int, Any] = Field(
default=None,
description="The position of an item in a series or sequence of items.",
)
encodingFormat: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)"
"and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)),"
"e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In"
"cases where a [[CreativeWork]] has several media type representations, [[encoding]]"
"can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]]"
"information.Unregistered or niche encoding and file formats can be indicated instead"
"via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.",
)
copyrightYear: Optional[
Union[
List[Union[str, Any, StrictInt, StrictFloat]],
str,
Any,
StrictInt,
StrictFloat,
]
] = Field(
default=None,
description="The year during which the claimed copyright for the CreativeWork was first asserted.",
)
mainEntity: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the primary entity described in some page or other CreativeWork.",
)
creator: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The creator/author of this CreativeWork. This is the same as the Author property for"
"CreativeWork.",
)
teaches: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The item being described is intended to help a person learn the competency or learning"
"outcome defined by the referenced term.",
)
temporal: Union[List[Union[datetime, str, Any]], datetime, str, Any] = Field(
default=None,
description='The "temporal" property can be used in cases where more specific properties(e.g.'
"[[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]])"
"are not known to be appropriate.",
)
size: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A standardized size of a product or creative work, specified either through a simple"
"textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode,"
"or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]],"
"[[height]], [[depth]] and [[weight]] properties may be more applicable.",
)
translator: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Organization or person who adapts a creative work to different languages, regional"
"differences and technical requirements of a target market, or that translates during"
"some event.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
accountablePerson: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the Person that is legally accountable for the CreativeWork.",
)
accessibilityHazard: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A characteristic of the described resource that is physiologically dangerous to some"
"users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).",
)
contentRating: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Official rating of a piece of content—for example, 'MPAA PG-13'.",
)
recordedAt: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The Event where the CreativeWork was recorded. The CreativeWork may capture all or part"
"of the event.",
)
publication: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A publication event associated with the item.",
)
sdLicense: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A license document that applies to this structured data, typically indicated by URL.",
)
headline: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Headline of the article.",
)
materialExtent: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The quantity of the materials being described or an expression of the physical space"
"they occupy.",
)
inLanguage: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The language of the content or performance or used in an action. Please use one of the language"
"codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also"
"[[availableLanguage]].",
)
material: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="A material that something is made from, e.g. leather, wool, cotton, paper.",
)
datePublished: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="Date of first broadcast/publication.",
)
offers: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An offer to provide this item—for example, an offer to sell a product, rent the"
"DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]"
"to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can"
"also be used to describe a [[Demand]]. While this property is listed as expected on a number"
"of common types, it can be used in others. In that case, using a second type, such as Product"
"or a subtype of Product, can clarify the nature of the offer.",
)
hasPart: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some"
"sense).",
)
sourceOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The Organization on whose behalf the creator was working.",
)
sponsor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports a thing through a pledge, promise, or financial"
"contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.",
)
character: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Fictional person connected with a creative work.",
)
mediaItemAppearance: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="In the context of a [[MediaReview]], indicates specific media item(s) that are grouped"
"using a [[MediaReviewItem]].",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/MediaReviewItem.py
| 0.924227 | 0.312531 |
MediaReviewItem.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class WebContent(BaseModel):
"""WebContent is a type representing all [[WebPage]], [[WebSite]] and [[WebPageElement]] content. It is sometimes the case that detailed distinctions between Web pages, sites and their parts are not always important or obvious. The [[WebContent]] type makes it easier to describe Web-addressable content without requiring such distinctions to always be stated. (The intent is that the existing types [[WebPage]], [[WebSite]] and [[WebPageElement]] will eventually be declared as subtypes of [[WebContent]].)
References:
https://schema.org/WebContent
Note:
Model Depth 3
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
workTranslation: (Optional[Union[List[Union[str, Any]], str, Any]]): A work that is a translation of the content of this work. E.g. 西遊記 has an English workTranslation “Journey to the West”, a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese translation Tây du ký bình khảo.
educationalLevel: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The level in terms of progression through an educational or training context. Examples of educational levels include 'beginner', 'intermediate' or 'advanced', and formal sets of level indicators.
associatedMedia: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork. This property is a synonym for encoding.
exampleOfWork: (Optional[Union[List[Union[str, Any]], str, Any]]): A creative work that this work is an example/instance/realization/derivation of.
releasedEvent: (Optional[Union[List[Union[str, Any]], str, Any]]): The place and time the release was issued, expressed as a PublicationEvent.
version: (Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]): The version of the CreativeWork embodied by a specified resource.
locationCreated: (Optional[Union[List[Union[str, Any]], str, Any]]): The location where the CreativeWork was created, which may not be the same as the location depicted in the CreativeWork.
acquireLicensePage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page documenting how licenses can be purchased or otherwise acquired, for the current item.
thumbnailUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A thumbnail image relevant to the Thing.
provider: (Optional[Union[List[Union[str, Any]], str, Any]]): The service provider, service operator, or service performer; the goods producer. Another party (a seller) may offer those services or goods on behalf of the provider. A provider may also serve as the seller.
expires: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): Date the content expires and is no longer useful or available. For example a [[VideoObject]] or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]] fact check whose publisher wants to indicate that it may no longer be relevant (or helpful to highlight) after some date.
contentLocation: (Optional[Union[List[Union[str, Any]], str, Any]]): The location depicted or described in the content. For example, the location in a photograph or painting.
educationalUse: (Union[List[Union[str, Any]], str, Any]): The purpose of a work in the context of education; for example, 'assignment', 'group work'.
copyrightHolder: (Optional[Union[List[Union[str, Any]], str, Any]]): The party holding the legal copyright to the CreativeWork.
accessibilityControl: (Union[List[Union[str, Any]], str, Any]): Identifies input methods that are sufficient to fully control the described resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).
maintainer: (Optional[Union[List[Union[str, Any]], str, Any]]): A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other [[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions to, and/or publication of, some (typically complex) artifact. It is common for distributions of software and data to be based on "upstream" sources. When [[maintainer]] is applied to a specific version of something e.g. a particular version or packaging of a [[Dataset]], it is always possible that the upstream source has a different maintainer. The [[isBasedOn]] property can be used to indicate such relationships between datasets to make the different maintenance roles clear. Similarly in the case of software, a package may have dedicated maintainers working on integration into software distributions such as Ubuntu, as well as upstream maintainers of the underlying work.
educationalAlignment: (Optional[Union[List[Union[str, Any]], str, Any]]): An alignment to an established educational framework.This property should not be used where the nature of the alignment can be described using a simple property, for example to express that a resource [[teaches]] or [[assesses]] a competency.
spatial: (Optional[Union[List[Union[str, Any]], str, Any]]): The "spatial" property can be used in cases when more specific properties(e.g. [[locationCreated]], [[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.
publisher: (Optional[Union[List[Union[str, Any]], str, Any]]): The publisher of the creative work.
keywords: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Keywords or tags used to describe some item. Multiple textual entries in a keywords list are typically delimited by commas, or by repeating the property.
assesses: (Union[List[Union[str, Any]], str, Any]): The item being described is intended to assess the competency or learning outcome defined by the referenced term.
reviews: (Optional[Union[List[Union[str, Any]], str, Any]]): Review of the item.
isBasedOn: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A resource from which this work is derived or from which it is a modification or adaption.
mentions: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept.
publishingPrinciples: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The publishingPrinciples property indicates (typically via [[URL]]) a document describing the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]] writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles are those of the party primarily responsible for the creation of the [[CreativeWork]].While such policies are most typically expressed in natural language, sometimes related information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.
contributor: (Optional[Union[List[Union[str, Any]], str, Any]]): A secondary contributor to the CreativeWork or Event.
license: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A license document that applies to this content, typically indicated by URL.
citation: (Union[List[Union[str, Any]], str, Any]): A citation or reference to another creative work, such as another publication, web page, scholarly article, etc.
accessibilitySummary: (Union[List[Union[str, Any]], str, Any]): A human-readable summary of specific accessibility features or deficiencies, consistent with the other accessibility metadata but expressing subtleties such as "short descriptions are present but long descriptions will be needed for non-visual users" or "short descriptions are present and no long descriptions are needed."
award: (Union[List[Union[str, Any]], str, Any]): An award won by or for this item.
commentCount: (Optional[Union[List[Union[str, int, Any]], str, int, Any]]): The number of comments this CreativeWork (e.g. Article, Question or Answer) has received. This is most applicable to works published in Web sites with commenting system; additional comments may exist elsewhere.
temporalCoverage: (Union[List[Union[datetime, str, Any, AnyUrl]], datetime, str, Any, AnyUrl]): The temporalCoverage of a CreativeWork indicates the period that the content applies to, i.e. that it describes, either as a DateTime or as a textual string indicating a time period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals). In the case of a Dataset it will typically indicate the relevant time period in a precise notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012"). Other forms of content, e.g. ScholarlyArticle, Book, TVSeries or TVEpisode, may indicate their temporalCoverage in broader terms - textually or via well-known URL. Written works such as books may sometimes have precise temporal coverage too, e.g. a work set in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945".Open-ended date ranges can be written with ".." in place of the end date. For example, "2015-11/.." indicates a range beginning in November 2015 and with no specified final date. This is tentative and might be updated in future when ISO 8601 is officially updated.
dateCreated: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date on which the CreativeWork was created or the item was added to a DataFeed.
discussionUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A link to the page containing the comments of the CreativeWork.
copyrightNotice: (Union[List[Union[str, Any]], str, Any]): Text of a notice appropriate for describing the copyright aspects of this Creative Work, ideally indicating the owner of the copyright for the Work.
learningResourceType: (Union[List[Union[str, Any]], str, Any]): The predominant type or kind characterizing the learning resource. For example, 'presentation', 'handout'.
awards: (Union[List[Union[str, Any]], str, Any]): Awards won by or for this item.
accessModeSufficient: (Optional[Union[List[Union[str, Any]], str, Any]]): A list of single or combined accessModes that are sufficient to understand all the intellectual content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).
review: (Optional[Union[List[Union[str, Any]], str, Any]]): A review of the item.
conditionsOfAccess: (Union[List[Union[str, Any]], str, Any]): Conditions that affect the availability of, or method(s) of access to, an item. Typically used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]. This property is not suitable for use as a general Web access control mechanism. It is expressed only in natural language.For example "Available by appointment from the Reading Room" or "Accessible only from logged-in accounts ".
interactivityType: (Union[List[Union[str, Any]], str, Any]): The predominant mode of learning supported by the learning resource. Acceptable values are 'active', 'expositive', or 'mixed'.
abstract: (Union[List[Union[str, Any]], str, Any]): An abstract is a short description that summarizes a [[CreativeWork]].
fileFormat: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)) of the content, e.g. application/zip of a SoftwareApplication binary. In cases where a CreativeWork has several media type representations, 'encoding' can be used to indicate each MediaObject alongside particular fileFormat information. Unregistered or niche file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia entry.
interpretedAsClaim: (Optional[Union[List[Union[str, Any]], str, Any]]): Used to indicate a specific claim contained, implied, translated or refined from the content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can be indicated using [[claimInterpreter]].
text: (Union[List[Union[str, Any]], str, Any]): The textual content of this CreativeWork.
archivedAt: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible, but be archived by archival, journalistic, activist, or law enforcement organizations. In such cases, the referenced page may not directly publish the content.
alternativeHeadline: (Union[List[Union[str, Any]], str, Any]): A secondary title of the CreativeWork.
creditText: (Union[List[Union[str, Any]], str, Any]): Text that can be used to credit person(s) and/or organization(s) associated with a published Creative Work.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
interactionStatistic: (Optional[Union[List[Union[str, Any]], str, Any]]): The number of interactions for the CreativeWork using the WebSite or SoftwareApplication. The most specific child type of InteractionCounter should be used.
workExample: (Optional[Union[List[Union[str, Any]], str, Any]]): Example/instance/realization/derivation of the concept of this creative work. E.g. the paperback edition, first edition, or e-book.
about: (Optional[Union[List[Union[str, Any]], str, Any]]): The subject matter of the content.
encodings: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork.
funder: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports (sponsors) something through some kind of financial contribution.
video: (Optional[Union[List[Union[str, Any]], str, Any]]): An embedded video object.
isPartOf: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is part of.
pattern: (Union[List[Union[str, Any]], str, Any]): A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'. Values are typically expressed as text, although links to controlled value schemes are also supported.
editor: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the Person who edited the CreativeWork.
dateModified: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): The date on which the CreativeWork was most recently modified or when the item's entry was modified within a DataFeed.
translationOfWork: (Optional[Union[List[Union[str, Any]], str, Any]]): The work that this work has been translated from. E.g. 物种起源 is a translationOf “On the Origin of Species”.
creativeWorkStatus: (Union[List[Union[str, Any]], str, Any]): The status of a creative work in terms of its stage in a lifecycle. Example terms include Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for the stages of their publication lifecycle.
isBasedOnUrl: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A resource that was used in the creation of this resource. This term can be repeated for multiple sources. For example, http://example.com/great-multiplication-intro.html.
isFamilyFriendly: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): Indicates whether this content is family friendly.
isAccessibleForFree: (Optional[Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]]): A flag to signal that the item, event, or place is accessible for free.
author: (Optional[Union[List[Union[str, Any]], str, Any]]): The author of this content or rating. Please note that author is special in that HTML 5 provides a special mechanism for indicating authorship via the rel tag. That is equivalent to this and may be used interchangeably.
contentReferenceTime: (Optional[Union[List[Union[datetime, str, Any]], datetime, str, Any]]): The specific time described by a creative work, for works (e.g. articles, video objects etc.) that emphasise a particular moment within an Event.
correction: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]], textually or in another document.
sdDatePublished: (Optional[Union[List[Union[str, Any, date]], str, Any, date]]): Indicates the date on which the current structured data was generated / published. Typically used alongside [[sdPublisher]]
comment: (Optional[Union[List[Union[str, Any]], str, Any]]): Comments, typically from users.
countryOfOrigin: (Optional[Union[List[Union[str, Any]], str, Any]]): The country of origin of something, including products as well as creative works such as movie and TV content.In the case of TV and movie, this would be the country of the principle offices of the production company or individual responsible for the movie. For other kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties such as [[contentLocation]] and [[locationCreated]] may be more applicable.In the case of products, the country of origin of the product. The exact interpretation of this may vary by context and product type, and cannot be fully enumerated here.
timeRequired: (Optional[Union[List[Union[str, Any]], str, Any]]): Approximate or typical time it takes to work with or through this learning resource for the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.
typicalAgeRange: (Union[List[Union[str, Any]], str, Any]): The typical expected age range, e.g. '7-9', '11-'.
genre: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Genre of the creative work, broadcast channel or group.
producer: (Optional[Union[List[Union[str, Any]], str, Any]]): The person or organization who produced the work (e.g. music album, movie, TV/radio series etc.).
schemaVersion: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Indicates (by URL or string) a particular version of a schema used in some CreativeWork. This property was created primarily to indicate the use of a specific schema.org release, e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```. There may be situations in which other schemas might usefully be referenced this way, e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/``` but this has not been carefully explored in the community.
audience: (Optional[Union[List[Union[str, Any]], str, Any]]): An intended audience, i.e. a group for whom something was created.
encoding: (Optional[Union[List[Union[str, Any]], str, Any]]): A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.
publisherImprint: (Optional[Union[List[Union[str, Any]], str, Any]]): The publishing division which published the comic.
accessibilityAPI: (Union[List[Union[str, Any]], str, Any]): Indicates that the resource is compatible with the referenced accessibility API. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).
sdPublisher: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the party responsible for generating and publishing the current structured data markup, typically in cases where the structured data is derived automatically from existing published content but published on a different site. For example, student projects and open data initiatives often re-publish existing content with more explicitly structured metadata. The[[sdPublisher]] property helps make such practices more explicit.
audio: (Optional[Union[List[Union[str, Any]], str, Any]]): An embedded audio object.
accessibilityFeature: (Union[List[Union[str, Any]], str, Any]): Content features of the resource, such as accessible media, alternatives and supported enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).
spatialCoverage: (Optional[Union[List[Union[str, Any]], str, Any]]): The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of the content. It is a subproperty of contentLocation intended primarily for more technical and detailed materials. For example with a Dataset, it indicates areas that the dataset describes: a dataset of New York weather would have spatialCoverage which was the place: the state of New York.
accessMode: (Union[List[Union[str, Any]], str, Any]): The human sensory perceptual system or cognitive faculty through which a person may process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).
editEIDR: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]] representing a specific edit / edition for a work of film or television.For example, the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J" has several edits, e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3".Since schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description), or alongside [[editEIDR]] for a more edit-specific description.
usageInfo: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]. This property is applicable both to works that are freely available and to those that require payment or other transactions. It can reference additional information, e.g. community expectations on preferred linking and citation conventions, as well as purchasing details. For something that can be commercially licensed, usageInfo can provide detailed, resource-specific information about licensing options.This property can be used alongside the license property which indicates license(s) applicable to some piece of content. The usageInfo property can provide information about other licensing options, e.g. acquiring commercial usage rights for an image that is also available under non-commercial creative commons licenses.
position: (Union[List[Union[str, int, Any]], str, int, Any]): The position of an item in a series or sequence of items.
encodingFormat: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml) and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)), e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In cases where a [[CreativeWork]] has several media type representations, [[encoding]] can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]] information.Unregistered or niche encoding and file formats can be indicated instead via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.
copyrightYear: (Optional[Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]]): The year during which the claimed copyright for the CreativeWork was first asserted.
mainEntity: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates the primary entity described in some page or other CreativeWork.
creator: (Optional[Union[List[Union[str, Any]], str, Any]]): The creator/author of this CreativeWork. This is the same as the Author property for CreativeWork.
teaches: (Union[List[Union[str, Any]], str, Any]): The item being described is intended to help a person learn the competency or learning outcome defined by the referenced term.
temporal: (Union[List[Union[datetime, str, Any]], datetime, str, Any]): The "temporal" property can be used in cases where more specific properties(e.g. [[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]]) are not known to be appropriate.
size: (Union[List[Union[str, Any]], str, Any]): A standardized size of a product or creative work, specified either through a simple textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode, or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]], [[height]], [[depth]] and [[weight]] properties may be more applicable.
translator: (Optional[Union[List[Union[str, Any]], str, Any]]): Organization or person who adapts a creative work to different languages, regional differences and technical requirements of a target market, or that translates during some event.
aggregateRating: (Optional[Union[List[Union[str, Any]], str, Any]]): The overall rating, based on a collection of reviews or ratings, of the item.
accountablePerson: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the Person that is legally accountable for the CreativeWork.
accessibilityHazard: (Union[List[Union[str, Any]], str, Any]): A characteristic of the described resource that is physiologically dangerous to some users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).
contentRating: (Union[List[Union[str, Any]], str, Any]): Official rating of a piece of content—for example, 'MPAA PG-13'.
recordedAt: (Optional[Union[List[Union[str, Any]], str, Any]]): The Event where the CreativeWork was recorded. The CreativeWork may capture all or part of the event.
publication: (Optional[Union[List[Union[str, Any]], str, Any]]): A publication event associated with the item.
sdLicense: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): A license document that applies to this structured data, typically indicated by URL.
headline: (Union[List[Union[str, Any]], str, Any]): Headline of the article.
materialExtent: (Union[List[Union[str, Any]], str, Any]): The quantity of the materials being described or an expression of the physical space they occupy.
inLanguage: (Union[List[Union[str, Any]], str, Any]): The language of the content or performance or used in an action. Please use one of the language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also [[availableLanguage]].
material: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): A material that something is made from, e.g. leather, wool, cotton, paper.
datePublished: (Optional[Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]]): Date of first broadcast/publication.
offers: (Optional[Union[List[Union[str, Any]], str, Any]]): An offer to provide this item—for example, an offer to sell a product, rent the DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]] to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can also be used to describe a [[Demand]]. While this property is listed as expected on a number of common types, it can be used in others. In that case, using a second type, such as Product or a subtype of Product, can clarify the nature of the offer.
hasPart: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some sense).
sourceOrganization: (Optional[Union[List[Union[str, Any]], str, Any]]): The Organization on whose behalf the creator was working.
sponsor: (Optional[Union[List[Union[str, Any]], str, Any]]): A person or organization that supports a thing through a pledge, promise, or financial contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.
character: (Optional[Union[List[Union[str, Any]], str, Any]]): Fictional person connected with a creative work.
"""
type_: str = Field(default="WebContent", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
workTranslation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A work that is a translation of the content of this work. E.g. 西遊記 has an English workTranslation"
"“Journey to the West”, a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese"
"translation Tây du ký bình khảo.",
)
educationalLevel: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The level in terms of progression through an educational or training context. Examples"
"of educational levels include 'beginner', 'intermediate' or 'advanced', and formal"
"sets of level indicators.",
)
associatedMedia: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork. This property is a synonym for encoding.",
)
exampleOfWork: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A creative work that this work is an example/instance/realization/derivation of.",
)
releasedEvent: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The place and time the release was issued, expressed as a PublicationEvent.",
)
version: Union[
List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat
] = Field(
default=None,
description="The version of the CreativeWork embodied by a specified resource.",
)
locationCreated: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The location where the CreativeWork was created, which may not be the same as the location"
"depicted in the CreativeWork.",
)
acquireLicensePage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page documenting how licenses can be purchased or otherwise acquired, for"
"the current item.",
)
thumbnailUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A thumbnail image relevant to the Thing.",
)
provider: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The service provider, service operator, or service performer; the goods producer."
"Another party (a seller) may offer those services or goods on behalf of the provider."
"A provider may also serve as the seller.",
)
expires: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="Date the content expires and is no longer useful or available. For example a [[VideoObject]]"
"or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]]"
"fact check whose publisher wants to indicate that it may no longer be relevant (or helpful"
"to highlight) after some date.",
)
contentLocation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The location depicted or described in the content. For example, the location in a photograph"
"or painting.",
)
educationalUse: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The purpose of a work in the context of education; for example, 'assignment', 'group"
"work'.",
)
copyrightHolder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The party holding the legal copyright to the CreativeWork.",
)
accessibilityControl: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Identifies input methods that are sufficient to fully control the described resource."
"Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityControl-vocabulary).",
)
maintainer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other"
"[[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions"
"to, and/or publication of, some (typically complex) artifact. It is common for distributions"
'of software and data to be based on "upstream" sources. When [[maintainer]] is applied'
"to a specific version of something e.g. a particular version or packaging of a [[Dataset]],"
"it is always possible that the upstream source has a different maintainer. The [[isBasedOn]]"
"property can be used to indicate such relationships between datasets to make the different"
"maintenance roles clear. Similarly in the case of software, a package may have dedicated"
"maintainers working on integration into software distributions such as Ubuntu, as"
"well as upstream maintainers of the underlying work.",
)
educationalAlignment: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An alignment to an established educational framework.This property should not be used"
"where the nature of the alignment can be described using a simple property, for example"
"to express that a resource [[teaches]] or [[assesses]] a competency.",
)
spatial: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description='The "spatial" property can be used in cases when more specific properties(e.g. [[locationCreated]],'
"[[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.",
)
publisher: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The publisher of the creative work.",
)
keywords: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Keywords or tags used to describe some item. Multiple textual entries in a keywords list"
"are typically delimited by commas, or by repeating the property.",
)
assesses: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The item being described is intended to assess the competency or learning outcome defined"
"by the referenced term.",
)
reviews: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Review of the item.",
)
isBasedOn: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A resource from which this work is derived or from which it is a modification or adaption.",
)
mentions: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates that the CreativeWork contains a reference to, but is not necessarily about"
"a concept.",
)
publishingPrinciples: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing"
"the editorial principles of an [[Organization]] (or individual, e.g. a [[Person]]"
"writing a blog) that relate to their activities as a publisher, e.g. ethics or diversity"
"policies. When applied to a [[CreativeWork]] (e.g. [[NewsArticle]]) the principles"
"are those of the party primarily responsible for the creation of the [[CreativeWork]].While"
"such policies are most typically expressed in natural language, sometimes related"
"information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.",
)
contributor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A secondary contributor to the CreativeWork or Event.",
)
license: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A license document that applies to this content, typically indicated by URL.",
)
citation: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A citation or reference to another creative work, such as another publication, web page,"
"scholarly article, etc.",
)
accessibilitySummary: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A human-readable summary of specific accessibility features or deficiencies, consistent"
'with the other accessibility metadata but expressing subtleties such as "short descriptions'
'are present but long descriptions will be needed for non-visual users" or "short descriptions'
'are present and no long descriptions are needed."',
)
award: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An award won by or for this item.",
)
commentCount: Optional[Union[List[Union[str, int, Any]], str, int, Any]] = Field(
default=None,
description="The number of comments this CreativeWork (e.g. Article, Question or Answer) has received."
"This is most applicable to works published in Web sites with commenting system; additional"
"comments may exist elsewhere.",
)
temporalCoverage: Union[
List[Union[datetime, str, Any, AnyUrl]], datetime, str, Any, AnyUrl
] = Field(
default=None,
description="The temporalCoverage of a CreativeWork indicates the period that the content applies"
"to, i.e. that it describes, either as a DateTime or as a textual string indicating a time"
"period in [ISO 8601 time interval format](https://en.wikipedia.org/wiki/ISO_8601#Time_intervals)."
"In the case of a Dataset it will typically indicate the relevant time period in a precise"
'notation (e.g. for a 2011 census dataset, the year 2011 would be written "2011/2012").'
"Other forms of content, e.g. ScholarlyArticle, Book, TVSeries or TVEpisode, may indicate"
"their temporalCoverage in broader terms - textually or via well-known URL. Written"
"works such as books may sometimes have precise temporal coverage too, e.g. a work set"
'in 1939 - 1945 can be indicated in ISO 8601 interval format format via "1939/1945".Open-ended'
'date ranges can be written with ".." in place of the end date. For example, "2015-11/.."'
"indicates a range beginning in November 2015 and with no specified final date. This is"
"tentative and might be updated in future when ISO 8601 is officially updated.",
)
dateCreated: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date on which the CreativeWork was created or the item was added to a DataFeed.",
)
discussionUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A link to the page containing the comments of the CreativeWork.",
)
copyrightNotice: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Text of a notice appropriate for describing the copyright aspects of this Creative Work,"
"ideally indicating the owner of the copyright for the Work.",
)
learningResourceType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The predominant type or kind characterizing the learning resource. For example, 'presentation',"
"'handout'.",
)
awards: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Awards won by or for this item.",
)
accessModeSufficient: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A list of single or combined accessModes that are sufficient to understand all the intellectual"
"content of a resource. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessModeSufficient-vocabulary).",
)
review: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A review of the item.",
)
conditionsOfAccess: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Conditions that affect the availability of, or method(s) of access to, an item. Typically"
"used for real world items such as an [[ArchiveComponent]] held by an [[ArchiveOrganization]]."
"This property is not suitable for use as a general Web access control mechanism. It is"
'expressed only in natural language.For example "Available by appointment from the'
'Reading Room" or "Accessible only from logged-in accounts ".',
)
interactivityType: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The predominant mode of learning supported by the learning resource. Acceptable values"
"are 'active', 'expositive', or 'mixed'.",
)
abstract: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An abstract is a short description that summarizes a [[CreativeWork]].",
)
fileFormat: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Media type, typically MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml))"
"of the content, e.g. application/zip of a SoftwareApplication binary. In cases where"
"a CreativeWork has several media type representations, 'encoding' can be used to indicate"
"each MediaObject alongside particular fileFormat information. Unregistered or niche"
"file formats can be indicated instead via the most appropriate URL, e.g. defining Web"
"page or a Wikipedia entry.",
)
interpretedAsClaim: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Used to indicate a specific claim contained, implied, translated or refined from the"
"content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can"
"be indicated using [[claimInterpreter]].",
)
text: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The textual content of this CreativeWork.",
)
archivedAt: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case"
"of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible,"
"but be archived by archival, journalistic, activist, or law enforcement organizations."
"In such cases, the referenced page may not directly publish the content.",
)
alternativeHeadline: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A secondary title of the CreativeWork.",
)
creditText: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Text that can be used to credit person(s) and/or organization(s) associated with a published"
"Creative Work.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
interactionStatistic: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication."
"The most specific child type of InteractionCounter should be used.",
)
workExample: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Example/instance/realization/derivation of the concept of this creative work. E.g."
"the paperback edition, first edition, or e-book.",
)
about: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The subject matter of the content.",
)
encodings: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork.",
)
funder: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports (sponsors) something through some kind of financial"
"contribution.",
)
video: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An embedded video object.",
)
isPartOf: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is"
"part of.",
)
pattern: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'."
"Values are typically expressed as text, although links to controlled value schemes"
"are also supported.",
)
editor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the Person who edited the CreativeWork.",
)
dateModified: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="The date on which the CreativeWork was most recently modified or when the item's entry"
"was modified within a DataFeed.",
)
translationOfWork: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The work that this work has been translated from. E.g. 物种起源 is a translationOf “On the"
"Origin of Species”.",
)
creativeWorkStatus: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The status of a creative work in terms of its stage in a lifecycle. Example terms include"
"Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for"
"the stages of their publication lifecycle.",
)
isBasedOnUrl: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="A resource that was used in the creation of this resource. This term can be repeated for"
"multiple sources. For example, http://example.com/great-multiplication-intro.html.",
)
isFamilyFriendly: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="Indicates whether this content is family friendly.",
)
isAccessibleForFree: Optional[
Union[List[Union[str, StrictBool, Any]], str, StrictBool, Any]
] = Field(
default=None,
description="A flag to signal that the item, event, or place is accessible for free.",
)
author: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The author of this content or rating. Please note that author is special in that HTML 5"
"provides a special mechanism for indicating authorship via the rel tag. That is equivalent"
"to this and may be used interchangeably.",
)
contentReferenceTime: Optional[
Union[List[Union[datetime, str, Any]], datetime, str, Any]
] = Field(
default=None,
description="The specific time described by a creative work, for works (e.g. articles, video objects"
"etc.) that emphasise a particular moment within an Event.",
)
correction: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]],"
"textually or in another document.",
)
sdDatePublished: Optional[
Union[List[Union[str, Any, date]], str, Any, date]
] = Field(
default=None,
description="Indicates the date on which the current structured data was generated / published. Typically"
"used alongside [[sdPublisher]]",
)
comment: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Comments, typically from users.",
)
countryOfOrigin: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The country of origin of something, including products as well as creative works such"
"as movie and TV content.In the case of TV and movie, this would be the country of the principle"
"offices of the production company or individual responsible for the movie. For other"
"kinds of [[CreativeWork]] it is difficult to provide fully general guidance, and properties"
"such as [[contentLocation]] and [[locationCreated]] may be more applicable.In the"
"case of products, the country of origin of the product. The exact interpretation of this"
"may vary by context and product type, and cannot be fully enumerated here.",
)
timeRequired: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Approximate or typical time it takes to work with or through this learning resource for"
"the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.",
)
typicalAgeRange: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The typical expected age range, e.g. '7-9', '11-'.",
)
genre: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Genre of the creative work, broadcast channel or group.",
)
producer: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The person or organization who produced the work (e.g. music album, movie, TV/radio"
"series etc.).",
)
schemaVersion: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Indicates (by URL or string) a particular version of a schema used in some CreativeWork."
"This property was created primarily to indicate the use of a specific schema.org release,"
"e.g. ```10.0``` as a simple string, or more explicitly via URL, ```https://schema.org/docs/releases.html#v10.0```."
"There may be situations in which other schemas might usefully be referenced this way,"
"e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/```"
"but this has not been carefully explored in the community.",
)
audience: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An intended audience, i.e. a group for whom something was created.",
)
encoding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.",
)
publisherImprint: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The publishing division which published the comic.",
)
accessibilityAPI: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Indicates that the resource is compatible with the referenced accessibility API. Values"
"should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityAPI-vocabulary).",
)
sdPublisher: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the party responsible for generating and publishing the current structured"
"data markup, typically in cases where the structured data is derived automatically"
"from existing published content but published on a different site. For example, student"
"projects and open data initiatives often re-publish existing content with more explicitly"
"structured metadata. The[[sdPublisher]] property helps make such practices more"
"explicit.",
)
audio: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An embedded audio object.",
)
accessibilityFeature: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Content features of the resource, such as accessible media, alternatives and supported"
"enhancements for accessibility. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityFeature-vocabulary).",
)
spatialCoverage: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of"
"the content. It is a subproperty of contentLocation intended primarily for more technical"
"and detailed materials. For example with a Dataset, it indicates areas that the dataset"
"describes: a dataset of New York weather would have spatialCoverage which was the place:"
"the state of New York.",
)
accessMode: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The human sensory perceptual system or cognitive faculty through which a person may"
"process or perceive information. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessMode-vocabulary).",
)
editEIDR: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="An [EIDR](https://eidr.org/) (Entertainment Identifier Registry) [[identifier]]"
"representing a specific edit / edition for a work of film or television.For example,"
'the motion picture known as "Ghostbusters" whose [[titleEIDR]] is "10.5240/7EC7-228A-510A-053E-CBB8-J"'
'has several edits, e.g. "10.5240/1F2A-E1C5-680A-14C6-E76B-I" and "10.5240/8A35-3BEE-6497-5D12-9E4F-3".Since'
"schema.org types like [[Movie]] and [[TVEpisode]] can be used for both works and their"
"multiple expressions, it is possible to use [[titleEIDR]] alone (for a general description),"
"or alongside [[editEIDR]] for a more edit-specific description.",
)
usageInfo: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]."
"This property is applicable both to works that are freely available and to those that"
"require payment or other transactions. It can reference additional information, e.g."
"community expectations on preferred linking and citation conventions, as well as purchasing"
"details. For something that can be commercially licensed, usageInfo can provide detailed,"
"resource-specific information about licensing options.This property can be used"
"alongside the license property which indicates license(s) applicable to some piece"
"of content. The usageInfo property can provide information about other licensing options,"
"e.g. acquiring commercial usage rights for an image that is also available under non-commercial"
"creative commons licenses.",
)
position: Union[List[Union[str, int, Any]], str, int, Any] = Field(
default=None,
description="The position of an item in a series or sequence of items.",
)
encodingFormat: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="Media type typically expressed using a MIME format (see [IANA site](http://www.iana.org/assignments/media-types/media-types.xhtml)"
"and [MDN reference](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types)),"
"e.g. application/zip for a SoftwareApplication binary, audio/mpeg for .mp3 etc.In"
"cases where a [[CreativeWork]] has several media type representations, [[encoding]]"
"can be used to indicate each [[MediaObject]] alongside particular [[encodingFormat]]"
"information.Unregistered or niche encoding and file formats can be indicated instead"
"via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.",
)
copyrightYear: Optional[
Union[
List[Union[str, Any, StrictInt, StrictFloat]],
str,
Any,
StrictInt,
StrictFloat,
]
] = Field(
default=None,
description="The year during which the claimed copyright for the CreativeWork was first asserted.",
)
mainEntity: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates the primary entity described in some page or other CreativeWork.",
)
creator: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The creator/author of this CreativeWork. This is the same as the Author property for"
"CreativeWork.",
)
teaches: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The item being described is intended to help a person learn the competency or learning"
"outcome defined by the referenced term.",
)
temporal: Union[List[Union[datetime, str, Any]], datetime, str, Any] = Field(
default=None,
description='The "temporal" property can be used in cases where more specific properties(e.g.'
"[[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]])"
"are not known to be appropriate.",
)
size: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A standardized size of a product or creative work, specified either through a simple"
"textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode,"
"or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]],"
"[[height]], [[depth]] and [[weight]] properties may be more applicable.",
)
translator: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Organization or person who adapts a creative work to different languages, regional"
"differences and technical requirements of a target market, or that translates during"
"some event.",
)
aggregateRating: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The overall rating, based on a collection of reviews or ratings, of the item.",
)
accountablePerson: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the Person that is legally accountable for the CreativeWork.",
)
accessibilityHazard: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A characteristic of the described resource that is physiologically dangerous to some"
"users. Related to WCAG 2.0 guideline 2.3. Values should be drawn from the [approved vocabulary](https://www.w3.org/2021/a11y-discov-vocab/latest/#accessibilityHazard-vocabulary).",
)
contentRating: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Official rating of a piece of content—for example, 'MPAA PG-13'.",
)
recordedAt: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The Event where the CreativeWork was recorded. The CreativeWork may capture all or part"
"of the event.",
)
publication: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A publication event associated with the item.",
)
sdLicense: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="A license document that applies to this structured data, typically indicated by URL.",
)
headline: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Headline of the article.",
)
materialExtent: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The quantity of the materials being described or an expression of the physical space"
"they occupy.",
)
inLanguage: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The language of the content or performance or used in an action. Please use one of the language"
"codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also"
"[[availableLanguage]].",
)
material: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="A material that something is made from, e.g. leather, wool, cotton, paper.",
)
datePublished: Optional[
Union[List[Union[datetime, str, Any, date]], datetime, str, Any, date]
] = Field(
default=None,
description="Date of first broadcast/publication.",
)
offers: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="An offer to provide this item—for example, an offer to sell a product, rent the"
"DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]"
"to indicate the kind of transaction offered, i.e. sell, lease, etc. This property can"
"also be used to describe a [[Demand]]. While this property is listed as expected on a number"
"of common types, it can be used in others. In that case, using a second type, such as Product"
"or a subtype of Product, can clarify the nature of the offer.",
)
hasPart: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some"
"sense).",
)
sourceOrganization: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The Organization on whose behalf the creator was working.",
)
sponsor: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A person or organization that supports a thing through a pledge, promise, or financial"
"contribution. E.g. a sponsor of a Medical Study or a corporate sponsor of an event.",
)
character: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Fictional person connected with a creative work.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/WebContent.py
| 0.925693 | 0.307449 |
WebContent.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class WearableMeasurementHeight(BaseModel):
"""Measurement of the height, for example the heel height of a shoe
References:
https://schema.org/WearableMeasurementHeight
Note:
Model Depth 6
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
supersededBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Relates a term (i.e. a property, class or enumeration) to one that supersedes it.
"""
type_: str = Field(default="WearableMeasurementHeight", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
supersededBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/WearableMeasurementHeight.py
| 0.945349 | 0.374362 |
WearableMeasurementHeight.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class DrugLegalStatus(BaseModel):
"""The legal availability status of a medical drug.
References:
https://schema.org/DrugLegalStatus
Note:
Model Depth 4
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
recognizingAuthority: (Optional[Union[List[Union[str, Any]], str, Any]]): If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.
relevantSpecialty: (Optional[Union[List[Union[str, Any]], str, Any]]): If applicable, a medical specialty in which this entity is relevant.
medicineSystem: (Optional[Union[List[Union[str, Any]], str, Any]]): The system of medicine that includes this MedicalEntity, for example 'evidence-based', 'homeopathic', 'chiropractic', etc.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
legalStatus: (Union[List[Union[str, Any]], str, Any]): The drug or supplement's legal status, including any controlled substance schedules that apply.
study: (Optional[Union[List[Union[str, Any]], str, Any]]): A medical study or trial related to this entity.
guideline: (Optional[Union[List[Union[str, Any]], str, Any]]): A medical guideline related to this entity.
code: (Optional[Union[List[Union[str, Any]], str, Any]]): A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.
applicableLocation: (Optional[Union[List[Union[str, Any]], str, Any]]): The location in which the status applies.
"""
type_: str = Field(default="DrugLegalStatus", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
recognizingAuthority: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="If applicable, the organization that officially recognizes this entity as part of its"
"endorsed system of medicine.",
)
relevantSpecialty: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="If applicable, a medical specialty in which this entity is relevant.",
)
medicineSystem: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The system of medicine that includes this MedicalEntity, for example 'evidence-based',"
"'homeopathic', 'chiropractic', etc.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
legalStatus: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The drug or supplement's legal status, including any controlled substance schedules"
"that apply.",
)
study: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A medical study or trial related to this entity.",
)
guideline: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A medical guideline related to this entity.",
)
code: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A medical code for the entity, taken from a controlled vocabulary or ontology such as"
"ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.",
)
applicableLocation: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The location in which the status applies.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/DrugLegalStatus.py
| 0.938003 | 0.345906 |
DrugLegalStatus.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class MaximumDoseSchedule(BaseModel):
"""The maximum dosing schedule considered safe for a drug or supplement as recommended by an authority or by the drug/supplement's manufacturer. Capture the recommending authority in the recognizingAuthority property of MedicalEntity.
References:
https://schema.org/MaximumDoseSchedule
Note:
Model Depth 5
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
recognizingAuthority: (Optional[Union[List[Union[str, Any]], str, Any]]): If applicable, the organization that officially recognizes this entity as part of its endorsed system of medicine.
relevantSpecialty: (Optional[Union[List[Union[str, Any]], str, Any]]): If applicable, a medical specialty in which this entity is relevant.
medicineSystem: (Optional[Union[List[Union[str, Any]], str, Any]]): The system of medicine that includes this MedicalEntity, for example 'evidence-based', 'homeopathic', 'chiropractic', etc.
funding: (Optional[Union[List[Union[str, Any]], str, Any]]): A [[Grant]] that directly or indirectly provide funding or sponsorship for this item. See also [[ownershipFundingInfo]].
legalStatus: (Union[List[Union[str, Any]], str, Any]): The drug or supplement's legal status, including any controlled substance schedules that apply.
study: (Optional[Union[List[Union[str, Any]], str, Any]]): A medical study or trial related to this entity.
guideline: (Optional[Union[List[Union[str, Any]], str, Any]]): A medical guideline related to this entity.
code: (Optional[Union[List[Union[str, Any]], str, Any]]): A medical code for the entity, taken from a controlled vocabulary or ontology such as ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.
targetPopulation: (Union[List[Union[str, Any]], str, Any]): Characteristics of the population for which this is intended, or which typically uses it, e.g. 'adults'.
doseValue: (Optional[Union[List[Union[str, Any, StrictInt, StrictFloat]], str, Any, StrictInt, StrictFloat]]): The value of the dose, e.g. 500.
doseUnit: (Union[List[Union[str, Any]], str, Any]): The unit of the dose, e.g. 'mg'.
frequency: (Union[List[Union[str, Any]], str, Any]): How often the dose is taken, e.g. 'daily'.
"""
type_: str = Field(default="MaximumDoseSchedule", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
recognizingAuthority: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="If applicable, the organization that officially recognizes this entity as part of its"
"endorsed system of medicine.",
)
relevantSpecialty: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="If applicable, a medical specialty in which this entity is relevant.",
)
medicineSystem: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="The system of medicine that includes this MedicalEntity, for example 'evidence-based',"
"'homeopathic', 'chiropractic', etc.",
)
funding: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A [[Grant]] that directly or indirectly provide funding or sponsorship for this item."
"See also [[ownershipFundingInfo]].",
)
legalStatus: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The drug or supplement's legal status, including any controlled substance schedules"
"that apply.",
)
study: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A medical study or trial related to this entity.",
)
guideline: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A medical guideline related to this entity.",
)
code: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A medical code for the entity, taken from a controlled vocabulary or ontology such as"
"ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.",
)
targetPopulation: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="Characteristics of the population for which this is intended, or which typically uses"
"it, e.g. 'adults'.",
)
doseValue: Optional[
Union[
List[Union[str, Any, StrictInt, StrictFloat]],
str,
Any,
StrictInt,
StrictFloat,
]
] = Field(
default=None,
description="The value of the dose, e.g. 500.",
)
doseUnit: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The unit of the dose, e.g. 'mg'.",
)
frequency: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="How often the dose is taken, e.g. 'daily'.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/MaximumDoseSchedule.py
| 0.949035 | 0.381565 |
MaximumDoseSchedule.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class Nonprofit501c12(BaseModel):
"""Nonprofit501c12: Non-profit type referring to Benevolent Life Insurance Associations, Mutual Ditch or Irrigation Companies, Mutual or Cooperative Telephone Companies.
References:
https://schema.org/Nonprofit501c12
Note:
Model Depth 6
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
supersededBy: (Optional[Union[List[Union[str, Any]], str, Any]]): Relates a term (i.e. a property, class or enumeration) to one that supersedes it.
"""
type_: str = Field(default="Nonprofit501c12", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
supersededBy: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/Nonprofit501c12.py
| 0.941882 | 0.262074 |
Nonprofit501c12.py
|
pypi
|
from __future__ import annotations
from datetime import *
from time import *
from typing import *
from pydantic import *
class EnergyConsumptionDetails(BaseModel):
"""EnergyConsumptionDetails represents information related to the energy efficiency of a product that consumes energy. The information that can be provided is based on international regulations such as for example [EU directive 2017/1369](https://eur-lex.europa.eu/eli/reg/2017/1369/oj) for energy labeling and the [Energy labeling rule](https://www.ftc.gov/enforcement/rules/rulemaking-regulatory-reform-proceedings/energy-water-use-labeling-consumer) under the Energy Policy and Conservation Act (EPCA) in the US.
References:
https://schema.org/EnergyConsumptionDetails
Note:
Model Depth 3
Attributes:
potentialAction: (Optional[Union[List[Union[str, Any]], str, Any]]): Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role.
mainEntityOfPage: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): Indicates a page (or other CreativeWork) for which this thing is the main entity being described. See [background notes](/docs/datamodel.html#mainEntityBackground) for details.
subjectOf: (Optional[Union[List[Union[str, Any]], str, Any]]): A CreativeWork or Event about this Thing.
url: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of the item.
alternateName: (Union[List[Union[str, Any]], str, Any]): An alias for the item.
sameAs: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Wikidata entry, or official website.
description: (Union[List[Union[str, Any]], str, Any]): A description of the item.
disambiguatingDescription: (Union[List[Union[str, Any]], str, Any]): A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
identifier: (Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]): The identifier property represents any kind of identifier for any kind of [[Thing]], such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for representing many of these, either as textual strings or as URL (URI) links. See [background notes](/docs/datamodel.html#identifierBg) for more details.
image: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].
name: (Union[List[Union[str, Any]], str, Any]): The name of the item.
additionalType: (Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]]): An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally.
hasEnergyEfficiencyCategory: (Optional[Union[List[Union[str, Any]], str, Any]]): Defines the energy efficiency Category (which could be either a rating out of range of values or a yes/no certification) for a product according to an international energy efficiency standard.
energyEfficiencyScaleMin: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the least energy efficient class on the regulated EU energy consumption scale for the product category a product belongs to. For example, energy consumption for televisions placed on the market after January 1, 2020 is scaled from D to A+++.
energyEfficiencyScaleMax: (Optional[Union[List[Union[str, Any]], str, Any]]): Specifies the most energy efficient class on the regulated EU energy consumption scale for the product category a product belongs to. For example, energy consumption for televisions placed on the market after January 1, 2020 is scaled from D to A+++.
"""
type_: str = Field(default="EnergyConsumptionDetails", alias="@type", const=True)
potentialAction: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Indicates a potential Action, which describes an idealized action in which this thing"
"would play an 'object' role.",
)
mainEntityOfPage: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="Indicates a page (or other CreativeWork) for which this thing is the main entity being"
"described. See [background notes](/docs/datamodel.html#mainEntityBackground)"
"for details.",
)
subjectOf: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="A CreativeWork or Event about this Thing.",
)
url: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of the item.",
)
alternateName: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="An alias for the item.",
)
sameAs: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the"
"URL of the item's Wikipedia page, Wikidata entry, or official website.",
)
description: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A description of the item.",
)
disambiguatingDescription: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="A sub property of description. A short description of the item used to disambiguate from"
"other, similar items. Information from other properties (in particular, name) may"
"be necessary for the description to be useful for disambiguation.",
)
identifier: Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any] = Field(
default=None,
description="The identifier property represents any kind of identifier for any kind of [[Thing]],"
"such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for"
"representing many of these, either as textual strings or as URL (URI) links. See [background"
"notes](/docs/datamodel.html#identifierBg) for more details.",
)
image: Optional[Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]] = Field(
default=None,
description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].",
)
name: Union[List[Union[str, Any]], str, Any] = Field(
default=None,
description="The name of the item.",
)
additionalType: Optional[
Union[List[Union[str, AnyUrl, Any]], str, AnyUrl, Any]
] = Field(
default=None,
description="An additional type for the item, typically used for adding more specific types from external"
"vocabularies in microdata syntax. This is a relationship between something and a class"
"that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof'"
"attribute - for multiple types. Schema.org tools may have only weaker understanding"
"of extra types, in particular those defined externally.",
)
hasEnergyEfficiencyCategory: Optional[
Union[List[Union[str, Any]], str, Any]
] = Field(
default=None,
description="Defines the energy efficiency Category (which could be either a rating out of range of"
"values or a yes/no certification) for a product according to an international energy"
"efficiency standard.",
)
energyEfficiencyScaleMin: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the least energy efficient class on the regulated EU energy consumption scale"
"for the product category a product belongs to. For example, energy consumption for televisions"
"placed on the market after January 1, 2020 is scaled from D to A+++.",
)
energyEfficiencyScaleMax: Optional[Union[List[Union[str, Any]], str, Any]] = Field(
default=None,
description="Specifies the most energy efficient class on the regulated EU energy consumption scale"
"for the product category a product belongs to. For example, energy consumption for televisions"
"placed on the market after January 1, 2020 is scaled from D to A+++.",
)
|
/schemaorg_types-0.4.0.tar.gz/schemaorg_types-0.4.0/schemaorg_types/EnergyConsumptionDetails.py
| 0.951504 | 0.45175 |
EnergyConsumptionDetails.py
|
pypi
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.