You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This needs to be lifted out into other schemastypeBlock@entity {
id: ID!blockHeight: BigInteger!timeStamp: BigInteger!
}
enumPropertyType {
Bool Uint16 Uint32 Uint64 Int16 Int32 Int64 Text Reference VecBool VecUint16 VecUint32 VecUint64 VecInt16 VecInt32 VecInt64 VecText VecReference
}
typeProperty@entity {
id: ID! # Runtime identifier for property in classpropertyID: BigInteger! # ==================================== # The next four fields flatten representation of property type and permissions # Type of propertypropertyType: PropertyType! # Upper bound for vector length when property is a vector.lengthIfVec: BigInteger # What class which must be references when property is a reference.mustReferenceClassWhenReference: Class # Owner of referenced entity must be the same as source when property is a reference.mustBeSameControllerWhenReferenceType: Boolean # ==================================== # If property value can be skipped, when adding entity schema supportrequired: Boolean! # Used to enforce uniqeness of a property across all entities that have this propertyunique: Boolean! # Name of propertyname: String! # Description of propertydescription: String! # Property is locked from maintainerisLockedFromMaintainer: Boolean! # Property is locked from controllerisLockedFromController: Boolean! # Schemas which involve this propertyschemas: [Schema!] @derivedFrom(field: "properties")
}
typeSchema@entity {
id: ID! # Runtime identifier of schema in classschemaId: BigInteger! # Class to which this schema correspondsclass: Class! # Properties of class that are in this schemaproperties: [Property!]
# If schema can be added to an entityisActive: Boolean!
}
typeClass@entity {
id: ID! # Runtime identifier for classclassId: BigInteger! # All properties that have been used on this class across different class schemas.properties: [Property!]
# All schemas that are available for this class, think v0.0 Person, v.1.0 Person, etc.schemas: [Schema!]
# Name of classname: String! # Description of classdescription: String! # The maximum number of entities which can be created.maximumEntitiesCount: BigInteger! # The current number of entities which exist.currentNumberOfEntities: BigInteger! # How many entities a given controller may create at most.defaultEntityCreationVoucherUpperBound: BigInteger! # For this permission, the individual member is allowed to create the entity and become controller.anyMemberCanCreate: bool # Whether to prevent everyone from creating an entityentityCreationBlocked: Boolean! # Whether to prevent everyone from updating entity properties.allEntityPropertyValuesLocked: Boolean! # Current class maintainer curator groupsmaintainers: [CuratorGroup!]e # All vouchers for this classvouchers: [EntityCreationVoucher!] @derivedFrom(field: "class")
}
typePropertyValue@entity {
id: ID! # Runtime identifier of property value in entitypropertyValueID: BigInteger! # Property to which this value correspondsproperty: Property! ######################### # The next fields encode a flattened representation of non-vector properties, # only one of the below will be non-null.bool: Booleaninteger: BigIntegertext: Bytesreference: Entity ######################### # The next fields encode a flattened representation of vector properties, # only one of the below will be non-null.boolVec: [Boolean!]
intVec: [BigInteger!]
textVec: [Bytes!]
referenceVec: [Entity!]
nonce: BigInteger!
}
enumEntityControllerType {
Lead Member Maintainer
}
typeEntityController@entity {
id: ID! # Current controller, which is initially set based on who created entitycontrollerType: EntityControllerType! # The member which is the controller if its a membercontrollerWhenMember: Member # TODO! # Add reverse lookup for events
}
typeEntity@entity {
id: ID! # Runtime identifier for entityentityID: BigInteger! # Controls this entitycontroller: EntityController! # Forbid groups to mutate any property value.isFrozen: Boolean! # Prevent from being referenced by any entity (including self-references)referenceable: Boolean! # The class of this entityclass: Class! # What schemas under which this entity of a class is availablesupportedSchemas: [Schema!]
# Values for properties on class that are used by some schema used by this entity!values: [PropertyValue!]
# Total number of inbound references from another entitiestotalNumberOfInboundRefernces: BigInteger! # Number of inbound references from another entities with `SameOwner` flag setsameOwnerInboundReferences: BigInteger! # TODO! # Add reverse lookup for events
}
# Actors################### Instance is created when worker is added to curator frtypeCurator@entity {
id: ID! # UNIQUEworker: Worker!groups:
# TODO!events: [ContentDirectoryEvent!]
}
# Should be created whenver lead is added to corresponding working grouptypeCurationLead@entity {
id: ID! # UNIQUEworkingGroupLead: Lead! # This Lead is not defined in this schemaevents: [ContentDirectoryEvent!]
}
typeCuratorGroup@entity {
id: ID! # Runtime identifier for groupgroupId: BigInteger! # Whether group is removedisRemoved: Boolean! # Activity stats of groupisActive: Boolean! # All member curators of this groupcurators: [Curator!]
# All classes this group maintainsmaintainerOfClasses: [Class!] @derivedFrom(field: "maintainers")
# TODO! # Add reverse lookup for events
}
typeEntityCreationVoucher@entity {
id: ID! # Class to which voucher appliesclass: Class! # Controller to which this voucher appliescontroller: EntityController! # How many are allowed in totalmaximumEntitiesCount: BigInteger! # How many have currently been createdentitiesCreated: BigInteger!
}
# TODO# 1. fix events <== reverse lookup event & itnerfaces# 2. add curator concept again ... remove all workers.# 4.# 3. full text search! <== we may need to introduce specific types.# 5. Contne dir types: mutiple sources, data objects, platlform content, et.interfaceContentDirectoryEvent {
id: ID!blockHeight: BigInteger!
}
# Event only generated by lead actionsinterfaceContentDirectoryLeadEvent {
id: ID!blockHeight: BigInteger!CurationLead: CurationLead!
}
# Event generated by actions open to any actorinterfaceContentDirectoryActorEvent {
id: ID!actor: Actor!blockHeight: BigInteger!
}
typeCuratorGroupAdded@entity {
id: ID! # Added groupcuratorGroup: CuratorGroup!
}
typeCuratorGroupRemoved@entity {
id: ID! # Removed groupcuratorGroup: CuratorGroup!
}
typeCuratorGroupStatusSet@entity {
id: ID! # Group whos status is setcuratorGroup: CuratorGroup! # New activity statusisActive: Boolean!
}
typeCuratorAdded@entity {
id: ID! # Group to which curator is addedcuratorGroup: CuratorGroup! # Worker as curatorworker: Worker!
}
typeCuratorRemoved@entity {
id: ID! # Group from which curator is removedcuratorGroup: CuratorGroup! # Worker as curatorworker: Worker!
}
typeMaintainerAdded@entity {
id: ID! # Class to which maintainer is addedclass: Class! # Group added as maintainercuratorGroup: CuratorGroup!
}
typeMaintainerRemoved@entity {
id: ID! # Class from which maintainer is removedclass: Class! # Group from which maintainer is removedcuratorGroup: CuratorGroup!
}
typeEntityCreationVoucherUpdated@entity {
id: ID!
(EntityController, EntityCreationVoucher),
}
typeEntityCreationVoucherCreated@entity {
id: ID!
(EntityController, EntityCreationVoucher),
}
typeClassCreated@entity {
id: ID! # Created classclass: Class!
}
typeClassPermissionsUpdated@entity {
id: ID! # Created classclass: Class! # When set is new value of Class.anyMemberCanCreateupdatedAnyMemberCanCreate: Boolean # When set is new value of Class.entityCreationBlockedupdatedEntityCreationBlocked: Boolean # When set is new value of Class.maintainersupdatedAllEntityPropertyValuesLocked: Boolean # New set of curator groups set as maintainersupdatedMaintainers: [CuratorGroup!]
}
typeClassSchemaAdded@entity {
id: ID! # ...class: Class! # ...existingProperties: [Property!]
# ...newProperties: [Property!]
# ...newSchema: Schema!
}
typeClassSchemaStatusUpdated@entity {
id: ID! # ...class: Class! # ...schema: Schema! # ...newStatus: Boolean!
}
typeEntityPermissionsUpdated@entity {
# ...entity: Entity! # ...updatedFrozenForController: Boolean # ...updatedReferenceable: Boolean
}
enumActorType {
CuratorGroupMember Member Lead
}
typeActor@entity {
id: ID! # The type of actortype: ActorType # The curator group and actual curator when the actor type is `ActorType.CuratorGroup`groupWhenCuratorGroupMember: CuratorGroupcuratorWhenCuratorGroupMember: Curator # The member when the actor type is `ActorType.Member`member: Member # The lead when the actor type is `ActorType.Lead`lead: CurationLead
}
typeEntityCreated@entity {
id: ID! # ...actor: Actor! # ...class: Class! # ...sentity: Entity!
}
typeEntityRemoved@entity {
id: ID! # ...actor: Actor! # ...entityID: BigInteger! # other side-effects?
}
typeEntitySchemaSupportAdded@entity {
id: ID! # ...actor: Actor! # ...entity: Entity! # ...schema: Schema! # Values provided by callerpropertyValues: [PropertyValue!]
# other side-effects?
}
typeEntityPropertyValuesUpdated@entity {
id: ID! # ...actor: Actor! # ...entity: Entity! # Values provided by callernewPropertyValues: [PropertyValue!]
# other side-effects?
}
typeEntityPropertyValueVectorCleared@entity {
id: ID! # ...actor: Actor! # ...entity: Entity! # Property clearedproperty: Property! # other side-effects?
}
typeRemovedAtEntityPropertyValueVectorIndex@entity {
id: ID!actor: Actor!
(Actor, EntityId, PropertyId, VecMaxLength, Nonce),
actor: Actor<T>,
entity_id: T::EntityId,
in_class_schema_property_id: PropertyId,
index_in_property_vec: VecMaxLength,
nonce: T::Nonce # other side-effects?
}
typeInsertedAtEntityPropertyValueVectorIndex@entity {
id: ID!actor: Actor!
(Actor, EntityId, PropertyId, VecMaxLength, Nonce),
actor: Actor<T>,
entity_id: T::EntityId,
in_class_schema_property_id: PropertyId,
index_in_property_vec: VecMaxLength,
# singlePropertyValue: SinglePropertyValue<T>,nonce: T::Nonce # other side-effects?
}
typeTransactionCompleted@entity {
id: ID!actor: Actor! # operations: Vec<OperationType<T>> # other side-effects?
}
typeEntityOwnershipTransfered@entity {
id: ID!
(EntityId, EntityController),
entity_id: T::EntityId,
new_controller: EntityController<T>,
# other side-effects?
}
# High level derivative entities############ TODO# 3. full text search! <== we may need to introduce specific types.# 5. Contne dir types: mutiple sources, data objects, platlform content, et.# What is apparent in the schemas below is that, its not possible to define effective full text search on the bare bones representations found.# For example, to support doing a full text search over videos# Observation: follower # and other things dont live in chain...# Recommendations (not sure if they come from API)#enumLanguage {
Chinese English Arabic Portugese French # ...
}
typeChannel@entity {
id: ID! # Id of underlying entity.entityID: BigInteger!owner: Member!handle: String!@unique@fulltext(query: "universal_search")
description: String!coverPhotoURL: String!avatarPhotoURL: String!language: Languagevideos: [Video!] @derivedFrom(field: "channel")
series: [Series!] @derivedFrom(field: "channel")
playlists: [Playlist!] @derivedFrom(field: "channel")
}
typeCategory@entity {
id: ID! # Id of underlying entity.entityID: BigInteger!name: String!@uniquevideos: [Video!] @derivedFrom(field: "channel")
series: [Series!] @derivedFrom(field: "channel")
playlists: [Playlist!] @derivedFrom(field: "channel")
}
typeJoystreamVideoMediaLocation@variant {
dataObjectID: BigInteger!
}
typeHTTPVideoMediaLocation@variant {
host: String!port: Int
}
# In the future we can add IPFS, Dat, etc.unionMediaLocation = JoystreamMediaLocation | HTTPMediaLocation# Mixed both encoding and containers, only having popular combos, may need to be changed later.enumVideoMediaEncoding {
H264_mpeg4 VP8_WEBM Theroa_Vorbis
}
# Apparently there are lots of different Creative Commons licenses,# read about all here https://creativecommons.org/licenses/,# I haven't had the time.enumCreativeCommonsVersion {
CC_BY CC_BY_SA CC_BY_ND CC_BY_NC CC_BY_NC_SA CC_BY_NC_ND
}
typeCreativeCommonsLicense@variant {
version:
}
typeUserDefinedLicense@variant {
text: String!
}
unionLicense = UserDefinedLicense | CreativeCommonsLicensetypeVideoMedia@entity {
id: ID! # Id of underlying entity.entityID: BigInteger!encoding: VideoMediaEncoding! # Resolution widthpixelWidth: Int! # Resolution heightpixelHeight: Int! # Size in bytessize: BigInteger # where to findlocation: MediaLocation!
}
typeVideo@entity {
id: ID! # Id of underlying entity.entityID: BigInteger!channel: Channel!category: Category!title: String!@fulltext(query: "universal_search")
description: String!@fulltext(query: "universal_search")
# In secondsduration: Int! # In introskippableIntroDuration: IntthumbnailURL: String!Language: Languagemedia: VideoMedia!hasMarketing: Boolean # Timestamp of blockpublishedOnJoystreamInBlock: Block! # Possible time when video was published before JoystreampublishedBeforeJoystream: DateTimeisPublic: Bool!isCurated: Boolean!isExplicit: Boolean!license: License!inPlayLists: [VideoInPlaylistRelationship!] @derivedFrom(field: "video")
people: [PersonRoleInVideo!] @derivedFrom(field: "video")
}
typePlaylist@entity {
id: ID! # Id of underlying entity.entityID: BigInteger!title: String!@fulltext(query: "universal_search")
channel: Channel!category: Category!isPublic: Bool!contains: [VideoInPlaylistRelationship!] @derivedFrom(field: "playlist")
}
# We cannot use derived m-2-m relationship, because# we want to associate number also.typeVideoInPlaylistRelationship@entity {
id: ID!playlist: Playlist!video: Video!number: Int!
}
typeSeries@entity {
id: ID! # Id of underlying entity.entityID: BigInteger!name: String!@fulltext(query: "universal_search")
channel: Channel!category: Category!seasons: [SeriesSeason!] @derivedFrom(field: "channel")
# what people person are associated with this episode
}
typeSeriesSeason@entity {
id: ID! # Id of underlying entity.entityID: BigInteger!series: Series!episodes: [SeriesEpisode] @derivedFrom(field: "channel")
seasonNumberInSeries: Integer! # other stuff about when published?
}
typeSeriesEpisode@entity {
id: ID! # Id of underlying entity.entityID: BigInteger!seriesSeason: SeriesSeason!episodeNumberInSeason: Integer!title: String!@fulltext(query: "universal_search")
# what people person are associated with this episode
}
typePerson@entity {
id: ID! # Id of underlying entity.entityID: BigInteger!fullName: String!@fulltext(query: "universal_search")
born: DateTimedied: DateTimebio: String!
}
### type VideoContent @variant {# video: Video!# }## type SeriesContent @variant {# series: Series!# }## type SeriesEpisodeContent @variant {# seriesEpisode: SeriesEpisodeContent!# }## union Content = VideoContent | SeriesContent | SeriesEpisodeContent#typePersonRoleInVideo@entity {
id: ID! # Id of underlying entity.entityID: BigInteger!person: Person!video: Video! # Requires reference types in algebraic types # content: Content!name: String!description: String
}
# Note: it would be nice to have high level events as well, but how will it workinterfaceEvent {
id: ID!inBlock: Block!
}
# Events# These are just examples, later we add# full set of events for channels, videoes, series, series episodes, personaes, etc.typeChannelCreatedEvent@entityimplementEvent {
id: ID!
inBlock: Block!
channel: Channel!
}
typeVideoAddedToChannel@entityimplementEvent {
id: ID!
inBlock: Block!
video: Video!
}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: