class NamecoinDomainExtended(metaclass=Schema): name = 'Namecoin schema: Extended schema interpretation' Header = NamecoinDomainExplorer SchemaIP = SchemaObject(IP, mapping={IP.IP: Header.ip}) SchemaDomain = SchemaObject(Domain, mapping={Domain.Domain: Header.domain}) SchemaTxid = SchemaObject(NamecoinTXid, mapping={ NamecoinTXid.txid: Header.txid, NamecoinTXid.txid_short: Header.short_txid }) SchemaIPToDomain = IPToDomain.between( SchemaIP, SchemaDomain, mapping={IPToDomain.Resolved: Header.date_time}, conditions=[not_empty(Header.domain), not_empty(Header.ip)]) SchemaTxidToDomain = NamecoinTXidToDomain.between( SchemaTxid, SchemaDomain, mapping={NamecoinTXidToDomain.DateTime: Header.date_time}, conditions=[not_empty(Header.domain)]) SchemaTxidToIP = NamecoinTXidToIP.between( SchemaTxid, SchemaIP, mapping={NamecoinTXidToIP.DateTime: Header.date_time}, conditions=[not_empty(Header.domain), not_empty(Header.ip)])
class NamecoinNamecoinTxtoNamecoinAddress(metaclass=Schema): name = f'Namecoin schema: Namecoin transaction {Constants.RIGHTWARDS_ARROW} other(address, domain, ip)' Header = NamecoinTXnExplorer_out SchemaNamecoinTXid = SchemaObject(NamecoinTXid, mapping={ NamecoinTXid.txid: Header.txid, NamecoinTXid.txid_short: Header.short_txid }) SchemaAddress = SchemaObject(NamecoinAddress, mapping={ NamecoinAddress.namecoint_address: Header.address, NamecoinAddress.namecoint_address_short: Header.short_address }) SchemaSchemaNamecoinTXid_to_SchemaAddress = NamecoinTXidToAddress.between( SchemaNamecoinTXid, SchemaAddress, mapping={ NamecoinTXidToAddress.DateTime: Header.date_time, NamecoinTXidToAddress.Operation: Header.nameOp, NamecoinTXidToAddress.Domain: Header.raw_name, NamecoinTXidToAddress.Value: Header.value }) SchemaDomain = SchemaObject( Domain, mapping={Domain.Domain: Header.namecoin_domain}) SchemaIP = SchemaObject(IP, mapping={IP.IP: Header.ip}) SchemaAddressToIP = NamecoinAddressToIP.between( SchemaAddress, SchemaIP, mapping={NamecoinAddressToIP.DateTime: Header.date_time}, conditions=[not_empty(Header.ip)]) SchemaAddressToDomain = NamecoinAddressToDomain.between( SchemaAddress, SchemaDomain, mapping={NamecoinAddressToDomain.DateTime: Header.date_time}, conditions=[not_empty(Header.namecoin_domain)]) SchemaIPToDomain = IPToDomain.between( SchemaIP, SchemaDomain, mapping={IPToDomain.Resolved: Header.date_time}, conditions=[not_empty(Header.namecoin_domain), not_empty(Header.ip)])
class NamecoinDomainIP(metaclass=Schema): name = 'Namecoin schema: Domain and IP' Header = NamecoinDomainExplorer SchemaIP = SchemaObject(IP, mapping={IP.IP: Header.ip}) SchemaDomain = SchemaObject(Domain, mapping={Domain.Domain: Header.domain}) SchemaIPToDomain = IPToDomain.between( SchemaIP, SchemaDomain, mapping={IPToDomain.Resolved: Header.date_time}, conditions=[not_empty(Header.domain), not_empty(Header.ip)])
class NamecoinDomainIPBlock(metaclass=Schema): name = 'Namecoin schema: Netblock, Domain and IP' Header = NamecoinDomainExplorer SchemaIP = SchemaObject(IP, mapping={IP.IP: Header.ip}) SchemaDomain = SchemaObject(Domain, mapping={Domain.Domain: Header.domain}) Block = Netblock.schematic(Header) Connection = IPToNetblock.between(SchemaIP, Block, {}, [ Condition(Header.ip, Operations.NotEqual, ''), Condition(Header.Netblock, Operations.NotEqual, '') ]) SchemaIPToDomain = IPToDomain.between( SchemaIP, SchemaDomain, mapping={IPToDomain.Resolved: Header.date_time}, conditions=[not_empty(Header.domain), not_empty(Header.ip)])
class NamecoinDomainIPBlock(metaclass=Schema): name = f'Namecoin schema: Netblock, IP {Constants.RIGHTWARDS_ARROW} Domain' Header = NamecoinDomainExplorer SchemaIP = SchemaObject(IP, mapping={IP.IP: Header.ip}) SchemaDomain = SchemaObject(Domain, mapping={Domain.Domain: Header.domain}) SchemaBlock = SchemaObject(Netblock, mapping={Netblock.Netblock: Header.Netblock}) Connection = IPToNetblock.between(SchemaIP, SchemaBlock, {}, [ Condition(Header.ip, Operations.NotEqual, ''), Condition(Header.Netblock, Operations.NotEqual, '') ]) SchemaIPToDomain = IPToDomain.between( SchemaIP, SchemaDomain, mapping={IPToDomain.Resolved: Header.date_time}, conditions=[not_empty(Header.domain), not_empty(Header.ip)])
class NamecoinDomainBlocksExtended(metaclass=Schema): name = f'Namecoin schema: Netblock, IP {Constants.RIGHTWARDS_ARROW} Domain (ext.)' Header = NamecoinDomainExplorer SchemaIP = SchemaObject(IP, mapping={IP.IP: Header.ip}) SchemaDomain = SchemaObject(Domain, mapping={Domain.Domain: Header.domain}) SchemaTxid = SchemaObject(NamecoinTXid, mapping={ NamecoinTXid.txid: Header.txid, NamecoinTXid.txid_short: Header.short_txid }) SchemaBlock = SchemaObject(Netblock, mapping={Netblock.Netblock: Header.Netblock}) Connection = IPToNetblock.between(SchemaIP, SchemaBlock, {}, [ Condition(Header.ip, Operations.NotEqual, ''), Condition(Header.Netblock, Operations.NotEqual, '') ]) SchemaIPToDomain = IPToDomain.between( SchemaIP, SchemaDomain, mapping={IPToDomain.Resolved: Header.date_time}, conditions=[not_empty(Header.domain), not_empty(Header.ip)]) SchemaTxidToDomain = NamecoinTXidToDomain.between( SchemaTxid, SchemaDomain, mapping={NamecoinTXidToDomain.DateTime: Header.date_time}, conditions=[not_empty(Header.domain)]) SchemaTxidToIP = NamecoinTXidToIP.between( SchemaTxid, SchemaIP, mapping={NamecoinTXidToIP.DateTime: Header.date_time}, conditions=[not_empty(Header.domain), not_empty(Header.ip)])