v0.0.1 - initial working generation

This commit is contained in:
sneakers-the-rat 2024-01-13 03:23:50 -08:00
parent abe84e0df2
commit 26e3b1ef0c
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D
33 changed files with 49119 additions and 857 deletions

View file

@ -8,18 +8,14 @@ SHELL := bash
RUN = poetry run
# get values from about.yaml file
SCHEMA_NAME = $(shell ${SHELL} ./utils/get-value.sh name)
SOURCE_SCHEMA_PATH = $(shell ${SHELL} ./utils/get-value.sh source_schema_path)
SCHEMA_NAME = "linkml_activitypub"
SOURCE_SCHEMA_PATH = "linkml_activitypub/activitypub.yaml"
SOURCE_SCHEMA_DIR = $(dir $(SOURCE_SCHEMA_PATH))
SRC = src
DEST = project
PYMODEL = $(SRC)/$(SCHEMA_NAME)/datamodel
DEST = generated
PYMODEL = $(SCHEMA_NAME)
DOCDIR = docs
EXAMPLEDIR = examples
SHEET_MODULE = personinfo_enums
SHEET_ID = $(shell ${SHELL} ./utils/get-value.sh google_sheet_id)
SHEET_TABS = $(shell ${SHELL} ./utils/get-value.sh google_sheet_tabs)
SHEET_MODULE_PATH = $(SOURCE_SCHEMA_DIR)/$(SHEET_MODULE).yaml
# environment variables
include config.env
@ -103,8 +99,10 @@ gen-examples:
# generates all project files
gen-project: $(PYMODEL)
$(RUN) gen-project ${GEN_PARGS} -d $(DEST) $(SOURCE_SCHEMA_PATH) && mv $(DEST)/*.py $(PYMODEL)
$(RUN) gen-project ${GEN_PARGS} -d $(DEST) $(SOURCE_SCHEMA_PATH) && mv $(DEST)/*.py $(PYMODEL)/dataclass/
gen-pydantic: $(PYMODEL)
$(RUN) gen-pydantic $(SOURCE_SCHEMA_PATH) --pydantic-version 2 > $(PYMODEL)/activitypub.py
test: test-schema test-python test-examples
@ -185,4 +183,4 @@ clean:
rm -fr docs/*
rm -fr $(PYMODEL)/*
include project.Makefile
#include project.Makefile

View file

@ -2,6 +2,8 @@
LinkML representation of ActivityPub schema (which is mostly ActivityStreams except where it's not)
https://pypi.org/projects/linkml-activitypub
## Process
Intermediate files are in the `data` directory
@ -37,6 +39,7 @@ Then the final schema in `linkml_activitypub/activitypub.yaml`:
- `items` is marked as `list_elements_ordered: true` on `OrderedCollection` and false on `Collection`
- Made types
- anyURI as `xsd:anyURI`, did not try and find a validator pattern. The spec alternatingly uses its own anyURI prop and `xsd:anyURI`
- `duration` as a string that indicates it's a `xsd:duration`, finding a pattern is TODO
- Made enums
- `unitEnum` - for `unit`
- Copied Notes to class `description` rather than `comments`
@ -55,6 +58,7 @@ Need properties...
class definition, since `OrderedCollection` inherits from `Collection` but asserts that the `list_items_ordered` slot is `true`
rather than `false`. Instead, the slots from `CollectionPage` are just duplicated.
- Accordingly, the domain and range of slots that include `CollectionPage` also include `OrderedCollectionPage
- Need to implement some `xsd:duration` pattern
# References

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,67 @@
type Address
{
street: String
city: String
postalCode: String
}
type FamilialRelationship
{
startedAtTime: Date
endedAtTime: Date
relatedTo: String
type: FamilialRelationshipType!
relatedTo: Person!
}
interface HasAliases
{
aliases: [String]
}
type NamedThing
{
id: String!
name: String
description: String
image: String
}
type Organization implements HasAliases
{
id: String!
name: String
description: String
image: String
missionStatement: String
foundingDate: String
aliases: [String]
}
type Person implements HasAliases
{
id: String!
name: String
description: String
image: String
primaryEmail: String
birthDate: String
ageInYears: Integer
currentAddress: Address
hasFamilialRelationships: [FamilialRelationship]
aliases: [String]
}
type Registry
{
persons: [Person]
organizations: [Organization]
}
type Relationship
{
startedAtTime: Date
endedAtTime: Date
relatedTo: String
type: String
}

View file

@ -0,0 +1,97 @@
{
"comments": {
"description": "Auto generated by LinkML jsonld context generator",
"generation_date": "2024-01-13T03:10:04",
"source": "activitypub.yaml"
},
"@context": {
"as": "http://www.w3.org/ns/activitystreams#",
"linkml": "https://w3id.org/linkml/",
"owl": "http://www.w3.org/2002/07/owl#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"schema": "http://schema.org/",
"unit": "http://qudt.org/2.1/vocab/unit/",
"xml": {
"@id": "http://www.w3.org/XML/1998/namespace",
"@prefix": true
},
"xsd": "http://www.w3.org/2001/XMLSchema#",
"@vocab": "http://www.w3.org/ns/activitystreams#",
"accuracy": {
"@type": "xsd:float"
},
"altitude": {
"@type": "xsd:float"
},
"deleted": {
"@type": "xsd:dateTime"
},
"describes": {
"@type": "@id"
},
"duration": {
"@type": "xsd:duration"
},
"endTime": {
"@type": "xsd:dateTime"
},
"formerType": {
"@type": "@id"
},
"height": {
"@type": "xsd:nonNegativeInteger"
},
"href": {
"@type": "@id"
},
"id": {
"@type": "@id"
},
"latitude": {
"@type": "xsd:float"
},
"longitude": {
"@type": "xsd:float"
},
"name": {
"@id": "rdfs:name"
},
"published": {
"@type": "xsd:dateTime"
},
"radius": {
"@type": "xsd:float"
},
"relationship": {
"@type": "@id"
},
"replies": {
"@type": "@id"
},
"startIndex": {
"@type": "xsd:nonNegativeInteger"
},
"startTime": {
"@type": "xsd:dateTime"
},
"totalItems": {
"@type": "xsd:nonNegativeInteger"
},
"type": {
"@type": "@id"
},
"updated": {
"@type": "xsd:dateTime"
},
"width": {
"@type": "xsd:nonNegativeInteger"
},
"Property": {
"@id": "rdf:Property"
},
"Statement": {
"@id": "rdf:Statement"
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,76 @@
{
"_comments": "Auto generated from activitystreams.yaml by jsonldcontextgen.py version: 0.1.1\n Generation date: 2022-09-06T10:01:44\n Schema: my_datamodel\n metamodel version: 1.7.0\n model version: None\n \n id: https://w3id.org/my_org/my_datamodel\n description: Enter a detailed description of your project here\n license: https://creativecommons.org/publicdomain/zero/1.0/\n ",
"@context": {
"PATO": {
"@id": "http://purl.obolibrary.org/obo/PATO_",
"@prefix": true
},
"biolink": "https://w3id.org/biolink/",
"famrel": "http://example.org/famrel/",
"linkml": "https://w3id.org/linkml/",
"my_datamodel": {
"@id": "https://w3id.org/my_org/my_datamodel",
"@prefix": true
},
"prov": "http://www.w3.org/ns/prov#",
"schema": "http://schema.org/",
"@vocab": "https://w3id.org/my_org/my_datamodel",
"age_in_years": {
"@type": "xsd:integer"
},
"birth_date": {
"@id": "schema:birthDate"
},
"current_address": {
"@type": "@id"
},
"description": {
"@id": "schema:description"
},
"employed_at": {
"@type": "@id"
},
"ended_at_time": {
"@type": "xsd:date",
"@id": "prov:endedAtTime"
},
"has_familial_relationships": {
"@type": "@id"
},
"id": "@id",
"image": {
"@id": "schema:image"
},
"is_current": {
"@type": "xsd:boolean"
},
"name": {
"@id": "schema:name"
},
"primary_email": {
"@id": "schema:email"
},
"organizations": {
"@type": "@id"
},
"persons": {
"@type": "@id"
},
"related_to": {
"@type": "@id"
},
"started_at_time": {
"@type": "xsd:date",
"@id": "prov:startedAtTime"
},
"Address": {
"@id": "schema:PostalAddress"
},
"Organization": {
"@id": "schema:Organization"
},
"Person": {
"@id": "schema:Person"
}
}
}

View file

@ -0,0 +1,824 @@
{
"name": "my_datamodel",
"description": "Enter a detailed description of your project here",
"title": "My Datamodel",
"see_also": [
"https://example.org/"
],
"id": "https://w3id.org/my_org/my_datamodel",
"imports": [
"linkml:types"
],
"license": "https://creativecommons.org/publicdomain/zero/1.0/",
"prefixes": [
{
"prefix_prefix": "my_datamodel",
"prefix_reference": "https://w3id.org/my_org/my_datamodel"
},
{
"prefix_prefix": "linkml",
"prefix_reference": "https://w3id.org/linkml/"
},
{
"prefix_prefix": "biolink",
"prefix_reference": "https://w3id.org/biolink/"
},
{
"prefix_prefix": "schema",
"prefix_reference": "http://schema.org/"
},
{
"prefix_prefix": "PATO",
"prefix_reference": "http://purl.obolibrary.org/obo/PATO_"
},
{
"prefix_prefix": "famrel",
"prefix_reference": "http://example.org/famrel/"
}
],
"default_curi_maps": [
"semweb_context"
],
"default_prefix": "my_datamodel",
"default_range": "string",
"types": [
{
"name": "string",
"definition_uri": "https://w3id.org/linkml/String",
"description": "A character string",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "str",
"uri": "http://www.w3.org/2001/XMLSchema#string",
"@type": "TypeDefinition"
},
{
"name": "integer",
"definition_uri": "https://w3id.org/linkml/Integer",
"description": "An integer",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "int",
"uri": "http://www.w3.org/2001/XMLSchema#integer",
"@type": "TypeDefinition"
},
{
"name": "boolean",
"definition_uri": "https://w3id.org/linkml/Boolean",
"description": "A binary (true or false) value",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "Bool",
"uri": "http://www.w3.org/2001/XMLSchema#boolean",
"repr": "bool",
"@type": "TypeDefinition"
},
{
"name": "float",
"definition_uri": "https://w3id.org/linkml/Float",
"description": "A real number that conforms to the xsd:float specification",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "float",
"uri": "http://www.w3.org/2001/XMLSchema#float",
"@type": "TypeDefinition"
},
{
"name": "double",
"definition_uri": "https://w3id.org/linkml/Double",
"description": "A real number that conforms to the xsd:double specification",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "float",
"uri": "http://www.w3.org/2001/XMLSchema#double",
"@type": "TypeDefinition"
},
{
"name": "decimal",
"definition_uri": "https://w3id.org/linkml/Decimal",
"description": "A real number with arbitrary precision that conforms to the xsd:decimal specification",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "Decimal",
"uri": "http://www.w3.org/2001/XMLSchema#decimal",
"@type": "TypeDefinition"
},
{
"name": "time",
"definition_uri": "https://w3id.org/linkml/Time",
"description": "A time object represents a (local) time of day, independent of any particular day",
"notes": [
"URI is dateTime because OWL reasoners do not work with straight date or time"
],
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "XSDTime",
"uri": "http://www.w3.org/2001/XMLSchema#dateTime",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "date",
"definition_uri": "https://w3id.org/linkml/Date",
"description": "a date (year, month and day) in an idealized calendar",
"notes": [
"URI is dateTime because OWL reasoners don't work with straight date or time"
],
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "XSDDate",
"uri": "http://www.w3.org/2001/XMLSchema#date",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "datetime",
"definition_uri": "https://w3id.org/linkml/Datetime",
"description": "The combination of a date and time",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "XSDDateTime",
"uri": "http://www.w3.org/2001/XMLSchema#dateTime",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "date_or_datetime",
"definition_uri": "https://w3id.org/linkml/DateOrDatetime",
"description": "Either a date or a datetime",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "str",
"uri": "https://w3id.org/linkml/DateOrDatetime",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "uriorcurie",
"definition_uri": "https://w3id.org/linkml/Uriorcurie",
"description": "a URI or a CURIE",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "URIorCURIE",
"uri": "http://www.w3.org/2001/XMLSchema#anyURI",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "uri",
"definition_uri": "https://w3id.org/linkml/Uri",
"description": "a complete URI",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "URI",
"uri": "http://www.w3.org/2001/XMLSchema#anyURI",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "ncname",
"definition_uri": "https://w3id.org/linkml/Ncname",
"description": "Prefix part of CURIE",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "NCName",
"uri": "http://www.w3.org/2001/XMLSchema#string",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "objectidentifier",
"definition_uri": "https://w3id.org/linkml/Objectidentifier",
"description": "A URI or CURIE that represents an object in the model.",
"comments": [
"Used for inheritance and type checking"
],
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "ElementIdentifier",
"uri": "http://www.w3.org/ns/shex#iri",
"repr": "str",
"@type": "TypeDefinition"
},
{
"name": "nodeidentifier",
"definition_uri": "https://w3id.org/linkml/Nodeidentifier",
"description": "A URI, CURIE or BNODE that represents a node in a model.",
"from_schema": "https://w3id.org/linkml/types",
"imported_from": "linkml:types",
"base": "NodeIdentifier",
"uri": "http://www.w3.org/ns/shex#nonLiteral",
"repr": "str",
"@type": "TypeDefinition"
}
],
"enums": [
{
"name": "PersonStatus",
"definition_uri": "https://w3id.org/my_org/my_datamodelPersonStatus",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"permissible_values": [
{
"text": "ALIVE",
"description": "the person is living",
"meaning": "PATO:0001421"
},
{
"text": "DEAD",
"description": "the person is deceased",
"meaning": "PATO:0001422"
},
{
"text": "UNKNOWN",
"description": "the vital status is not known",
"todos": [
"map this to an ontology"
]
}
]
},
{
"name": "FamilialRelationshipType",
"definition_uri": "https://w3id.org/my_org/my_datamodelFamilialRelationshipType",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"permissible_values": [
{
"text": "SIBLING_OF",
"meaning": "famrel:01"
},
{
"text": "PARENT_OF",
"meaning": "famrel:02"
},
{
"text": "CHILD_OF",
"meaning": "famrel:01"
}
]
}
],
"slots": [
{
"name": "id",
"definition_uri": "https://w3id.org/my_org/my_datamodelid",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"mappings": [
"http://schema.org/identifier"
],
"slot_uri": "http://schema.org/identifier",
"identifier": true,
"owner": "NamedThing",
"domain_of": [
"NamedThing"
],
"range": "string",
"required": true,
"@type": "SlotDefinition"
},
{
"name": "name",
"definition_uri": "https://w3id.org/my_org/my_datamodelname",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"mappings": [
"http://schema.org/name"
],
"slot_uri": "http://schema.org/name",
"owner": "NamedThing",
"domain_of": [
"NamedThing"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "description",
"definition_uri": "https://w3id.org/my_org/my_datamodeldescription",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"mappings": [
"http://schema.org/description"
],
"slot_uri": "http://schema.org/description",
"owner": "NamedThing",
"domain_of": [
"NamedThing"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "image",
"definition_uri": "https://w3id.org/my_org/my_datamodelimage",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"mappings": [
"http://schema.org/image"
],
"slot_uri": "http://schema.org/image",
"owner": "NamedThing",
"domain_of": [
"NamedThing"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "primary_email",
"definition_uri": "https://w3id.org/my_org/my_datamodelprimary_email",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"mappings": [
"http://schema.org/email"
],
"slot_uri": "http://schema.org/email",
"owner": "Person",
"domain_of": [
"Person"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "birth_date",
"definition_uri": "https://w3id.org/my_org/my_datamodelbirth_date",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"mappings": [
"http://schema.org/birthDate"
],
"slot_uri": "http://schema.org/birthDate",
"owner": "Person",
"domain_of": [
"Person"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "employed_at",
"definition_uri": "https://w3id.org/my_org/my_datamodelemployed_at",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slot_uri": "https://w3id.org/my_org/my_datamodelemployed_at",
"range": "Organization",
"@type": "SlotDefinition"
},
{
"name": "is_current",
"definition_uri": "https://w3id.org/my_org/my_datamodelis_current",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slot_uri": "https://w3id.org/my_org/my_datamodelis_current",
"range": "boolean",
"@type": "SlotDefinition"
},
{
"name": "has_familial_relationships",
"definition_uri": "https://w3id.org/my_org/my_datamodelhas_familial_relationships",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slot_uri": "https://w3id.org/my_org/my_datamodelhas_familial_relationships",
"multivalued": true,
"owner": "Person",
"domain_of": [
"Person"
],
"range": "FamilialRelationship",
"inlined": true,
"inlined_as_list": true,
"@type": "SlotDefinition"
},
{
"name": "current_address",
"definition_uri": "https://w3id.org/my_org/my_datamodelcurrent_address",
"description": "The address at which a person currently lives",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slot_uri": "https://w3id.org/my_org/my_datamodelcurrent_address",
"owner": "Person",
"domain_of": [
"Person"
],
"range": "Address",
"inlined": true,
"@type": "SlotDefinition"
},
{
"name": "age_in_years",
"definition_uri": "https://w3id.org/my_org/my_datamodelage_in_years",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slot_uri": "https://w3id.org/my_org/my_datamodelage_in_years",
"owner": "Person",
"domain_of": [
"Person"
],
"range": "integer",
"minimum_value": 0,
"maximum_value": 999,
"@type": "SlotDefinition"
},
{
"name": "related_to",
"definition_uri": "https://w3id.org/my_org/my_datamodelrelated_to",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slot_uri": "https://w3id.org/my_org/my_datamodelrelated_to",
"owner": "Relationship",
"domain_of": [
"Relationship"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "type",
"definition_uri": "https://w3id.org/my_org/my_datamodeltype",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slot_uri": "https://w3id.org/my_org/my_datamodeltype",
"owner": "Relationship",
"domain_of": [
"Relationship"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "street",
"definition_uri": "https://w3id.org/my_org/my_datamodelstreet",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slot_uri": "https://w3id.org/my_org/my_datamodelstreet",
"owner": "Address",
"domain_of": [
"Address"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "city",
"definition_uri": "https://w3id.org/my_org/my_datamodelcity",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slot_uri": "https://w3id.org/my_org/my_datamodelcity",
"owner": "Address",
"domain_of": [
"Address"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "mission_statement",
"definition_uri": "https://w3id.org/my_org/my_datamodelmission_statement",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slot_uri": "https://w3id.org/my_org/my_datamodelmission_statement",
"owner": "Organization",
"domain_of": [
"Organization"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "founding_date",
"definition_uri": "https://w3id.org/my_org/my_datamodelfounding_date",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slot_uri": "https://w3id.org/my_org/my_datamodelfounding_date",
"owner": "Organization",
"domain_of": [
"Organization"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "postal_code",
"definition_uri": "https://w3id.org/my_org/my_datamodelpostal_code",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slot_uri": "https://w3id.org/my_org/my_datamodelpostal_code",
"owner": "Address",
"domain_of": [
"Address"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "started_at_time",
"definition_uri": "https://w3id.org/my_org/my_datamodelstarted_at_time",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"mappings": [
"http://www.w3.org/ns/prov#startedAtTime"
],
"slot_uri": "http://www.w3.org/ns/prov#startedAtTime",
"owner": "Relationship",
"domain_of": [
"Relationship"
],
"range": "date",
"@type": "SlotDefinition"
},
{
"name": "ended_at_time",
"definition_uri": "https://w3id.org/my_org/my_datamodelended_at_time",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"mappings": [
"http://www.w3.org/ns/prov#endedAtTime"
],
"slot_uri": "http://www.w3.org/ns/prov#endedAtTime",
"owner": "Relationship",
"domain_of": [
"Relationship"
],
"range": "date",
"@type": "SlotDefinition"
},
{
"name": "registry__persons",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slot_uri": "https://w3id.org/my_org/my_datamodelpersons",
"multivalued": true,
"alias": "persons",
"owner": "Registry",
"domain_of": [
"Registry"
],
"range": "Person",
"inlined": true,
"inlined_as_list": true,
"@type": "SlotDefinition"
},
{
"name": "registry__organizations",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slot_uri": "https://w3id.org/my_org/my_datamodelorganizations",
"multivalued": true,
"alias": "organizations",
"owner": "Registry",
"domain_of": [
"Registry"
],
"range": "Organization",
"inlined": true,
"inlined_as_list": true,
"@type": "SlotDefinition"
},
{
"name": "hasAliases__aliases",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"exact_mappings": [
"http://schema.org/alternateName"
],
"slot_uri": "https://w3id.org/my_org/my_datamodelaliases",
"multivalued": true,
"alias": "aliases",
"owner": "HasAliases",
"domain_of": [
"HasAliases"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "related_to",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slot_uri": "https://w3id.org/my_org/my_datamodelrelated_to",
"range": "Person",
"required": true,
"@type": "SlotDefinition"
},
{
"name": "Person_primary_email",
"definition_uri": "https://w3id.org/my_org/my_datamodelprimary_email",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"mappings": [
"http://schema.org/email"
],
"is_a": "primary_email",
"domain": "Person",
"slot_uri": "http://schema.org/email",
"alias": "primary_email",
"owner": "Person",
"domain_of": [
"Person"
],
"is_usage_slot": true,
"usage_slot_name": "primary_email",
"range": "string",
"pattern": "^\\S+@[\\S+\\.]+\\S+",
"@type": "SlotDefinition"
},
{
"name": "FamilialRelationship_type",
"definition_uri": "https://w3id.org/my_org/my_datamodeltype",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"is_a": "type",
"domain": "FamilialRelationship",
"slot_uri": "https://w3id.org/my_org/my_datamodeltype",
"alias": "type",
"owner": "FamilialRelationship",
"domain_of": [
"FamilialRelationship"
],
"is_usage_slot": true,
"usage_slot_name": "type",
"range": "FamilialRelationshipType",
"required": true,
"@type": "SlotDefinition"
},
{
"name": "FamilialRelationship_related_to",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"is_a": "related_to",
"domain": "FamilialRelationship",
"slot_uri": "https://w3id.org/my_org/my_datamodelrelated_to",
"alias": "related to",
"owner": "FamilialRelationship",
"domain_of": [
"FamilialRelationship"
],
"is_usage_slot": true,
"usage_slot_name": "related to",
"range": "Person",
"required": true,
"@type": "SlotDefinition"
}
],
"classes": [
{
"name": "Registry",
"definition_uri": "https://w3id.org/my_org/my_datamodelRegistry",
"description": "Top level data container",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slots": [
"registry__persons",
"registry__organizations"
],
"slot_usage": {},
"attributes": [
{
"name": "persons",
"multivalued": true,
"range": "Person",
"inlined": true,
"inlined_as_list": true,
"@type": "SlotDefinition"
},
{
"name": "organizations",
"multivalued": true,
"range": "Organization",
"inlined": true,
"inlined_as_list": true,
"@type": "SlotDefinition"
}
],
"class_uri": "https://w3id.org/my_org/my_datamodelRegistry",
"tree_root": true,
"@type": "ClassDefinition"
},
{
"name": "NamedThing",
"definition_uri": "https://w3id.org/my_org/my_datamodelNamedThing",
"description": "A generic grouping for any identifiable entity",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"close_mappings": [
"schema:Thing"
],
"slots": [
"id",
"name",
"description",
"image"
],
"slot_usage": {},
"class_uri": "https://w3id.org/my_org/my_datamodelNamedThing",
"@type": "ClassDefinition"
},
{
"name": "Person",
"definition_uri": "https://w3id.org/my_org/my_datamodelPerson",
"description": "A person (alive, dead, undead, or fictional).",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"mappings": [
"schema:Person"
],
"is_a": "NamedThing",
"mixins": [
"HasAliases"
],
"slots": [
"id",
"name",
"description",
"image",
"Person_primary_email",
"birth_date",
"age_in_years",
"current_address",
"has_familial_relationships",
"hasAliases__aliases"
],
"slot_usage": {},
"class_uri": "http://schema.org/Person",
"@type": "ClassDefinition"
},
{
"name": "HasAliases",
"definition_uri": "https://w3id.org/my_org/my_datamodelHasAliases",
"description": "A mixin applied to any class that can have aliases/alternateNames",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"mixin": true,
"slots": [
"hasAliases__aliases"
],
"slot_usage": {},
"attributes": [
{
"name": "aliases",
"exact_mappings": [
"schema:alternateName"
],
"multivalued": true,
"@type": "SlotDefinition"
}
],
"class_uri": "https://w3id.org/my_org/my_datamodelHasAliases",
"@type": "ClassDefinition"
},
{
"name": "Organization",
"definition_uri": "https://w3id.org/my_org/my_datamodelOrganization",
"description": "An organization such as a company or university",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"mappings": [
"schema:Organization"
],
"is_a": "NamedThing",
"mixins": [
"HasAliases"
],
"slots": [
"id",
"name",
"description",
"image",
"mission_statement",
"founding_date",
"hasAliases__aliases"
],
"slot_usage": {},
"class_uri": "http://schema.org/Organization",
"@type": "ClassDefinition"
},
{
"name": "Address",
"definition_uri": "https://w3id.org/my_org/my_datamodelAddress",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"mappings": [
"schema:PostalAddress"
],
"slots": [
"street",
"city",
"postal_code"
],
"slot_usage": {},
"class_uri": "http://schema.org/PostalAddress",
"@type": "ClassDefinition"
},
{
"name": "Relationship",
"definition_uri": "https://w3id.org/my_org/my_datamodelRelationship",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"slots": [
"started_at_time",
"ended_at_time",
"related_to",
"type"
],
"slot_usage": {},
"class_uri": "https://w3id.org/my_org/my_datamodelRelationship",
"@type": "ClassDefinition"
},
{
"name": "FamilialRelationship",
"definition_uri": "https://w3id.org/my_org/my_datamodelFamilialRelationship",
"from_schema": "https://w3id.org/my_org/my_datamodel",
"is_a": "Relationship",
"slots": [
"started_at_time",
"ended_at_time",
"related_to",
"FamilialRelationship_type",
"FamilialRelationship_related_to"
],
"slot_usage": {},
"class_uri": "https://w3id.org/my_org/my_datamodelFamilialRelationship",
"@type": "ClassDefinition"
}
],
"metamodel_version": "1.7.0",
"source_file": "activitystreams.yaml",
"source_file_date": "2022-09-06T10:00:58",
"source_file_size": 3771,
"generation_date": "2022-09-06T10:01:45",
"@type": "SchemaDefinition",
"@context": [
"project/jsonld/activitystreams.context.jsonld",
"https://w3id.org/linkml/types.context.jsonld",
{
"@base": "https://w3id.org/my_org/my_datamodel"
}
]
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,243 @@
{
"$defs": {
"Address": {
"additionalProperties": false,
"description": "",
"properties": {
"city": {
"type": "string"
},
"postal_code": {
"type": "string"
},
"street": {
"type": "string"
}
},
"required": [],
"title": "Address",
"type": "object"
},
"FamilialRelationship": {
"additionalProperties": false,
"description": "",
"properties": {
"ended_at_time": {
"format": "date",
"type": "string"
},
"related_to": {
"type": "string"
},
"started_at_time": {
"format": "date",
"type": "string"
},
"type": {
"$ref": "#/$defs/FamilialRelationshipType"
}
},
"required": [
"type",
"related_to"
],
"title": "FamilialRelationship",
"type": "object"
},
"FamilialRelationshipType": {
"description": "",
"enum": [
"SIBLING_OF",
"PARENT_OF",
"CHILD_OF"
],
"title": "FamilialRelationshipType",
"type": "string"
},
"NamedThing": {
"additionalProperties": false,
"description": "A generic grouping for any identifiable entity",
"properties": {
"description": {
"type": "string"
},
"id": {
"type": "string"
},
"image": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"id"
],
"title": "NamedThing",
"type": "object"
},
"Organization": {
"additionalProperties": false,
"description": "An organization such as a company or university",
"properties": {
"aliases": {
"items": {
"type": "string"
},
"type": "array"
},
"description": {
"type": "string"
},
"founding_date": {
"type": "string"
},
"id": {
"type": "string"
},
"image": {
"type": "string"
},
"mission_statement": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"id"
],
"title": "Organization",
"type": "object"
},
"Person": {
"additionalProperties": false,
"description": "A person (alive, dead, undead, or fictional).",
"properties": {
"age_in_years": {
"maximum": 999,
"minimum": 0,
"type": "integer"
},
"aliases": {
"items": {
"type": "string"
},
"type": "array"
},
"birth_date": {
"type": "string"
},
"current_address": {
"$ref": "#/$defs/Address",
"description": "The address at which a person currently lives"
},
"description": {
"type": "string"
},
"has_familial_relationships": {
"items": {
"$ref": "#/$defs/FamilialRelationship"
},
"type": "array"
},
"id": {
"type": "string"
},
"image": {
"type": "string"
},
"name": {
"type": "string"
},
"primary_email": {
"pattern": "^\\S+@[\\S+\\.]+\\S+",
"type": "string"
}
},
"required": [
"id"
],
"title": "Person",
"type": "object"
},
"PersonStatus": {
"description": "",
"enum": [
"ALIVE",
"DEAD",
"UNKNOWN"
],
"title": "PersonStatus",
"type": "string"
},
"Registry": {
"additionalProperties": false,
"description": "Top level data container",
"properties": {
"organizations": {
"items": {
"$ref": "#/$defs/Organization"
},
"type": "array"
},
"persons": {
"items": {
"$ref": "#/$defs/Person"
},
"type": "array"
}
},
"required": [],
"title": "Registry",
"type": "object"
},
"Relationship": {
"additionalProperties": false,
"description": "",
"properties": {
"ended_at_time": {
"format": "date",
"type": "string"
},
"related_to": {
"type": "string"
},
"started_at_time": {
"format": "date",
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [],
"title": "Relationship",
"type": "object"
}
},
"$id": "https://w3id.org/my_org/my_datamodel",
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": true,
"metamodel_version": "1.7.0",
"properties": {
"organizations": {
"items": {
"$ref": "#/$defs/Organization"
},
"type": "array"
},
"persons": {
"items": {
"$ref": "#/$defs/Person"
},
"type": "array"
}
},
"required": [],
"title": "my_datamodel",
"type": "object",
"version": null
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,343 @@
@prefix IAO: <http://purl.obolibrary.org/obo/IAO_> .
@prefix PATO: <http://purl.obolibrary.org/obo/PATO_> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix famrel: <http://example.org/famrel/> .
@prefix linkml: <https://w3id.org/linkml/> .
@prefix my_datamodel: <https://w3id.org/my_org/my_datamodel> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
linkml:SubsetDefinition a owl:Class ;
rdfs:label "subset_definition" .
linkml:TypeDefinition a owl:Class ;
rdfs:label "type_definition" .
linkml:topValue a owl:DatatypeProperty ;
rdfs:label "value" .
my_datamodel: a owl:Ontology ;
rdfs:label "my_datamodel" ;
IAO:0000700 my_datamodel:Address,
my_datamodel:HasAliases,
my_datamodel:NamedThing,
my_datamodel:Registry,
my_datamodel:Relationship ;
dcterms:license "https://creativecommons.org/publicdomain/zero/1.0/" ;
dcterms:title "My Datamodel" ;
rdfs:seeAlso "https://example.org/" ;
linkml:generation_date "2022-09-06T10:01:46" ;
linkml:metamodel_version "1.7.0" ;
linkml:source_file "activitystreams.yaml" ;
linkml:source_file_date "2022-09-06T10:00:58" ;
linkml:source_file_size 3771 .
my_datamodel:employed_at a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "employed_at" ;
rdfs:range my_datamodel:Organization .
my_datamodel:is_current a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "is_current" ;
rdfs:range linkml:Boolean .
my_datamodel:Registry a owl:Class,
linkml:ClassDefinition ;
rdfs:label "Registry" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:allValuesFrom my_datamodel:Person ;
owl:onProperty my_datamodel:persons ],
[ a owl:Restriction ;
owl:allValuesFrom my_datamodel:Organization ;
owl:onProperty my_datamodel:organizations ] ;
skos:definition "Top level data container" .
my_datamodel:age_in_years a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "age_in_years" ;
rdfs:range linkml:Integer .
my_datamodel:city a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "city" ;
rdfs:range linkml:String .
my_datamodel:current_address a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "current_address" ;
rdfs:range my_datamodel:Address ;
skos:definition "The address at which a person currently lives" .
my_datamodel:founding_date a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "founding_date" ;
rdfs:range linkml:String .
my_datamodel:has_familial_relationships a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "has_familial_relationships" ;
rdfs:range my_datamodel:FamilialRelationship .
my_datamodel:mission_statement a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "mission_statement" ;
rdfs:range linkml:String .
my_datamodel:organizations a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "organizations" ;
rdfs:range my_datamodel:Organization .
my_datamodel:persons a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "persons" ;
rdfs:range my_datamodel:Person .
my_datamodel:postal_code a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "postal_code" ;
rdfs:range linkml:String .
my_datamodel:street a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "street" ;
rdfs:range linkml:String .
famrel:02 a owl:Class,
my_datamodel:FamilialRelationshipType ;
rdfs:label "PARENT_OF" .
PATO:0001421 a owl:Class,
my_datamodel:PersonStatus ;
rdfs:label "ALIVE" .
PATO:0001422 a owl:Class,
my_datamodel:PersonStatus ;
rdfs:label "DEAD" .
schema:birthDate a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "birth_date" ;
rdfs:range linkml:String ;
skos:exactMatch schema:birthDate .
schema:description a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "description" ;
rdfs:range linkml:String ;
skos:exactMatch schema:description .
schema:email a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "primary_email" ;
rdfs:range linkml:String ;
skos:exactMatch schema:email .
schema:identifier a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "id" ;
rdfs:range linkml:String ;
skos:exactMatch schema:identifier .
schema:image a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "image" ;
rdfs:range linkml:String ;
skos:exactMatch schema:image .
schema:name a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "name" ;
rdfs:range linkml:String ;
skos:exactMatch schema:name .
<http://www.w3.org/ns/prov#endedAtTime> a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "ended_at_time" ;
rdfs:range linkml:Date ;
skos:exactMatch <http://www.w3.org/ns/prov#endedAtTime> .
<http://www.w3.org/ns/prov#startedAtTime> a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "started_at_time" ;
rdfs:range linkml:Date ;
skos:exactMatch <http://www.w3.org/ns/prov#startedAtTime> .
my_datamodel:FamilialRelationship a owl:Class,
linkml:ClassDefinition ;
rdfs:label "FamilialRelationship" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:onClass my_datamodel:FamilialRelationshipType ;
owl:onProperty my_datamodel:type ;
owl:qualifiedCardinality 1 ],
[ a owl:Restriction ;
owl:onClass my_datamodel:Person ;
owl:onProperty my_datamodel:related_to ;
owl:qualifiedCardinality 1 ],
my_datamodel:Relationship .
<https://w3id.org/my_org/my_datamodelPersonStatus#UNKNOWN> a owl:Class,
my_datamodel:PersonStatus ;
rdfs:label "UNKNOWN" .
my_datamodel:Relationship a owl:Class,
linkml:ClassDefinition ;
rdfs:label "Relationship" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty my_datamodel:related_to ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty my_datamodel:type ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:Date ;
owl:onProperty <http://www.w3.org/ns/prov#endedAtTime> ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:Date ;
owl:onProperty <http://www.w3.org/ns/prov#startedAtTime> ] .
my_datamodel:related_to a owl:ObjectProperty,
linkml:SlotDefinition .
my_datamodel:type a owl:ObjectProperty,
linkml:SlotDefinition ;
rdfs:label "type" ;
rdfs:range linkml:String .
famrel:01 a owl:Class,
my_datamodel:FamilialRelationshipType ;
rdfs:label "CHILD_OF",
"SIBLING_OF" .
my_datamodel:Address a owl:Class,
linkml:ClassDefinition ;
rdfs:label "Address" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty my_datamodel:city ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty my_datamodel:street ],
[ a owl:Restriction ;
owl:maxQualifiedCardinality 1 ;
owl:onClass linkml:String ;
owl:onProperty my_datamodel:postal_code ] ;
skos:exactMatch schema:PostalAddress .
my_datamodel:FamilialRelationshipType a owl:Class,
linkml:EnumDefinition ;
rdfs:label "FamilialRelationshipType" ;
owl:unionOf ( famrel:01 famrel:02 famrel:01 ) ;
linkml:permissible_values famrel:01,
famrel:02 .
my_datamodel:HasAliases a owl:Class,
linkml:ClassDefinition ;
rdfs:label "HasAliases" ;
rdfs:subClassOf [ a owl:Restriction ;
owl:allValuesFrom linkml:String ;
owl:onProperty my_datamodel:aliases ],