OEP: 7 Title: URI Schema Standard Author: zhoupw <[email protected]> Type: Standard Status: Active Created: 2018-10-22
The OEP-7 Proposal is a standard interface of URI schema, this standard allows for the implementation of mapping ontology DID to readable URI.
1. This OEP is used for user to register a meaningful and special domain using his ONTID. 2. User can bind any values(not only the wallet address) to this domain. 3. Frontend Apps can analyze the value from the domain by it's business logic. 4. Every domain has different levels and valid period.
def registerDomain(fulldomain, registerdid,idx, validto)This allows user to register a domain ,like standard URL, domain format can be *.a.ont, only contract admin can register the top level domain, top domain owner can register the sub level domain and this should trigger a "registerDomain" event.
The parameter fulldomain
should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters.
The parameter registerdid
is user's ONTID and the idx is user's wallet index of the ONTID.
The parameter idx
is the wallet index of registerdid.
The parameter validto
is time stamp for the domain expiration.
def updateValidPeriod(fulldomain,idx,validto)Update the domain's valid period by parent owner,this should trigger a 'updateValidPeriod' event.
The parameter fulldomain
should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters.
The parameter idx
is the wallet index of registerdid.
The parameter validto
is time stamp for the domain expiration.
def deleteDomain(fulldomain,idx)
Delete the domain,this should trigger a 'deleteDomain' event.
The parameter fulldomain
should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters.
The parameter idx
is the wallet index of registerdid.
def bindValue(fulldomain,idx, ctype,inputvalue)
Bind a value to the domain,this should trigger a 'bindValue' event.
The parameter fulldomain
should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters..
The parameter idx
is the wallet index of registerdid.
The parameter ctype
is value type.
The parameter inputvalue
is value to bind.
def transfer(fulldomain,idx,todid)
Transfer domain to other did, this should be only called by URI owner.
The parameter address
must be a 20-byte address. If not, this method must throw
an exception.
def transfer(fulldomain,idx,todid)Transfer domain to other did, this should be only called by URI owner. Note: transfer will not change the valid time of the domain.
The parameter fulldomain
should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters.
The parameter idx
is the wallet index of registerdid.
The parameter todid
is the receiver did.
def valueOf(fulldomain)
Returns the bind value domain.
The parameter fulldomain
should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters.
def validTo(fulldomain)
Returns the valid period of the domain.
The parameter fulldomain
should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters.
def ownerOf(fulldomain)
Returns the owner DID of the domain.
The parameter fulldomain
should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters.
def isDomainValid(fulldomain)
Return true if the domain is valid.
The parameter fulldomain
should be alphanumeric and no more than 253 characters, and every part should no more than 63 characters.
def getDomains(did)
Return the domains binded to the DID.
RegisterAction("transfer","domain","from","to")
The event must be triggered when tokens are transferred.
RegisterAction("registerDomain", "domain", "owner","validTo")
The event must be triggered on any successful calls to register.
RegisterAction("updateValidPeriod","domain","newvalid")
The event must be triggered on any successful calls to updateValidPeriod.
RegisterAction("bindValue","domain","ctype","value")
The event must be triggered on any successful calls to bindValue.
RegisterAction("deleteDomain","domain")
The event must be triggered on any successful calls to deleteDomain.
Python sample Python Template