Sunday, July 8, 2018

Ext RESCAL (run test)

brent@brent-P65-67HSHP:~/Downloads/Ext-RESCAL$ python extrescal.py --latent 2 --lmbda 0.001 --input tiny-mixed-example --outputentities entity.embeddings.csv --outputterms term.embeddings.csv --outputfactors latent.factors.csv --log extrescal.log
false http://www.invincea.com/ontologies/icas/1.0/dhcp#forAddress http://www.w3.org/2000/01/rdf-schema#comment the IP Address that was granted via a successful DHCP Lease
false http://www.invincea.com/ontologies/icas/1.0/dhcp#fromAuthority http://www.w3.org/2000/01/rdf-schema#label issued from
false http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease http://www.w3.org/2000/01/rdf-schema#comment A Lease for a single IP Address from a DHCP Pool to a Network Interface on a Host
false http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedto http://www.w3.org/2000/01/rdf-schema#label was issued to
false http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseEnd http://www.w3.org/2000/01/rdf-schema#label lease ended on
false http://www.invincea.com/ontologies/icas/1.0/dhcp#inPool http://www.w3.org/2000/01/rdf-schema#label belongs to DHCP Pool
false http://www.invincea.com/ontologies/icas/1.0/dhcp#forHostName http://www.w3.org/2000/01/rdf-schema#comment leases may identify themselves with a particular hostname, which may have its associated DNS Entry updated once the lease is granted. This is used extensively in Microsoft Active Directory
false http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress http://www.w3.org/2000/01/rdf-schema#comment this DHCP address pool is authoritative for this IP address, and controls leasing of it to client systems.
false http://www.invincea.com/ontologies/icas/1.0/dhcp http://purl.org/dc/elements/1.1/#date 2014
false http://www.invincea.com/ontologies/icas/1.0/dhcp#forAddress http://www.w3.org/2000/01/rdf-schema#label for address
false http://www.invincea.com/ontologies/icas/1.0/dhcp#leased http://www.w3.org/2000/01/rdf-schema#label was granted lease
false http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress http://www.invincea.com/ontologies/icas/1.0/tapio#signaturePriority 1
false http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseStart http://www.w3.org/2000/01/rdf-schema#label lease ended on
false http://www.invincea.com/ontologies/icas/1.0/dhcp http://www.w3.org/2000/01/rdf-schema#comment an ontology of DHCP Leases and Services.
false http://www.invincea.com/ontologies/icas/1.0/dhcp http://www.w3.org/2002/07/owl#versionInfo 1.0
false http://www.invincea.com/ontologies/icas/1.0/dhcp#forHostName http://www.w3.org/2000/01/rdf-schema#label for hostname
false http://www.invincea.com/ontologies/icas/1.0/dhcp#leased http://www.w3.org/2000/01/rdf-schema#comment this NIC was successfully granted this DHC lease for an IP Address
false http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedto http://www.w3.org/2000/01/rdf-schema#comment this lease was succesfully issued to a requesting NIC to grant it a temporary IP Address
false http://www.invincea.com/ontologies/icas/1.0/dhcp#issuedLease http://www.w3.org/2000/01/rdf-schema#comment This NIC issued a DHCP to the requesting NIC
false http://www.invincea.com/ontologies/icas/1.0/dhcp#Pool http://www.w3.org/2000/01/rdf-schema#comment DHCP assigns addresses to systems from a pool of assigned addresses.
false http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress http://www.w3.org/2000/01/rdf-schema#label controls assignment of
false http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseEnd http://www.w3.org/2000/01/rdf-schema#comment when the lease expired
false http://www.invincea.com/ontologies/icas/1.0/dhcp#issuedLease http://www.w3.org/2000/01/rdf-schema#label issued lease
false http://www.invincea.com/ontologies/icas/1.0/dhcp http://purl.org/dc/elements/1.1/#description Describes elements related to authentication mechanisms in systems that grant identity to users and requests to map them to privileges
false http://www.invincea.com/ontologies/icas/1.0/dhcp#Pool http://www.w3.org/2000/01/rdf-schema#label DHCP IP Address Pool
false http://www.invincea.com/ontologies/icas/1.0/dhcp http://purl.org/dc/elements/1.1/#creator Invincea Labs
false http://www.invincea.com/ontologies/icas/1.0/dhcp http://www.w3.org/2000/01/rdf-schema#label Dynamic Host Control Protocol Ontology
false http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseStart http://www.w3.org/2000/01/rdf-schema#comment when the lease was granted
false http://www.invincea.com/ontologies/icas/1.0/dhcp#inPool http://www.w3.org/2000/01/rdf-schema#comment this address has been allocated to a DHCP Pool, and is not permanently assigned to any particular host
false http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease http://www.w3.org/2000/01/rdf-schema#label DHCP Lease
false http://www.invincea.com/ontologies/icas/1.0/dhcp#fromAuthority http://www.w3.org/2000/01/rdf-schema#comment the NIC (and therefore MAC) address this lease was issued by.
here is the attributes dictionary
defaultdict(<type 'list'>, {0: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#forAddress'), u'http://www.w3.org/2000/01/rdf-schema#commentthe IP Address that was granted via a successful DHCP Lease'], 1: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#fromAuthority'), u'http://www.w3.org/2000/01/rdf-schema#labelissued from'], 2: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease'), u'http://www.w3.org/2000/01/rdf-schema#commentA Lease for a single IP Address from a DHCP Pool to a Network Interface on a Host'], 3: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedto'), u'http://www.w3.org/2000/01/rdf-schema#labelwas issued to'], 4: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseEnd'), u'http://www.w3.org/2000/01/rdf-schema#labellease ended on'], 5: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#inPool'), u'http://www.w3.org/2000/01/rdf-schema#labelbelongs to DHCP Pool'], 6: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#forHostName'), u'http://www.w3.org/2000/01/rdf-schema#commentleases may identify themselves with a particular hostname, which may have its associated DNS Entry updated once the lease is granted. This is used extensively in Microsoft Active Directory'], 7: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress'), u'http://www.w3.org/2000/01/rdf-schema#commentthis DHCP address pool is authoritative for this IP address, and controls leasing of it to client systems.'], 8: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp'), u'http://purl.org/dc/elements/1.1/#date2014'], 9: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#forAddress'), u'http://www.w3.org/2000/01/rdf-schema#labelfor address'], 10: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leased'), u'http://www.w3.org/2000/01/rdf-schema#labelwas granted lease'], 11: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress'), u'http://www.invincea.com/ontologies/icas/1.0/tapio#signaturePriority1'], 12: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseStart'), u'http://www.w3.org/2000/01/rdf-schema#labellease ended on'], 13: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp'), u'http://www.w3.org/2000/01/rdf-schema#commentan ontology of DHCP Leases and Services.'], 14: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp'), u'http://www.w3.org/2002/07/owl#versionInfo1.0'], 15: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#forHostName'), u'http://www.w3.org/2000/01/rdf-schema#labelfor hostname'], 16: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leased'), u'http://www.w3.org/2000/01/rdf-schema#commentthis NIC was successfully granted this DHC lease for an IP Address'], 17: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedto'), u'http://www.w3.org/2000/01/rdf-schema#commentthis lease was succesfully issued to a requesting NIC to grant it a temporary IP Address'], 18: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#issuedLease'), u'http://www.w3.org/2000/01/rdf-schema#commentThis NIC issued a DHCP to the requesting NIC'], 19: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Pool'), u'http://www.w3.org/2000/01/rdf-schema#commentDHCP assigns addresses to systems from a pool of assigned addresses. '], 20: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress'), u'http://www.w3.org/2000/01/rdf-schema#labelcontrols assignment of'], 21: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseEnd'), u'http://www.w3.org/2000/01/rdf-schema#commentwhen the lease expired'], 22: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#issuedLease'), u'http://www.w3.org/2000/01/rdf-schema#labelissued lease'], 23: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp'), u'http://purl.org/dc/elements/1.1/#descriptionDescribes elements related to authentication mechanisms in systems that grant identity to users and requests to map them to privileges'], 24: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Pool'), u'http://www.w3.org/2000/01/rdf-schema#labelDHCP IP Address Pool'], 25: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp'), u'http://purl.org/dc/elements/1.1/#creatorInvincea Labs'], 26: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp'), u'http://www.w3.org/2000/01/rdf-schema#labelDynamic Host Control Protocol Ontology'], 27: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseStart'), u'http://www.w3.org/2000/01/rdf-schema#commentwhen the lease was granted'], 28: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#inPool'), u'http://www.w3.org/2000/01/rdf-schema#commentthis address has been allocated to a DHCP Pool, and is not permanently assigned to any particular host'], 29: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease'), u'http://www.w3.org/2000/01/rdf-schema#labelDHCP Lease'], 30: [rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#fromAuthority'), u'http://www.w3.org/2000/01/rdf-schema#commentthe NIC (and therefore MAC) address this lease was issued by.']})
=================================
here is the predicate object string list
[u'http://www.w3.org/2000/01/rdf-schema#commentthe IP Address that was granted via a successful DHCP Lease', u'http://www.w3.org/2000/01/rdf-schema#labelissued from', u'http://www.w3.org/2000/01/rdf-schema#commentA Lease for a single IP Address from a DHCP Pool to a Network Interface on a Host', u'http://www.w3.org/2000/01/rdf-schema#labelwas issued to', u'http://www.w3.org/2000/01/rdf-schema#labellease ended on', u'http://www.w3.org/2000/01/rdf-schema#labelbelongs to DHCP Pool', u'http://www.w3.org/2000/01/rdf-schema#commentleases may identify themselves with a particular hostname, which may have its associated DNS Entry updated once the lease is granted. This is used extensively in Microsoft Active Directory', u'http://www.w3.org/2000/01/rdf-schema#commentthis DHCP address pool is authoritative for this IP address, and controls leasing of it to client systems.', u'http://purl.org/dc/elements/1.1/#date2014', u'http://www.w3.org/2000/01/rdf-schema#labelfor address', u'http://www.w3.org/2000/01/rdf-schema#labelwas granted lease', u'http://www.invincea.com/ontologies/icas/1.0/tapio#signaturePriority1', u'http://www.w3.org/2000/01/rdf-schema#labellease ended on', u'http://www.w3.org/2000/01/rdf-schema#commentan ontology of DHCP Leases and Services.', u'http://www.w3.org/2002/07/owl#versionInfo1.0', u'http://www.w3.org/2000/01/rdf-schema#labelfor hostname', u'http://www.w3.org/2000/01/rdf-schema#commentthis NIC was successfully granted this DHC lease for an IP Address', u'http://www.w3.org/2000/01/rdf-schema#commentthis lease was succesfully issued to a requesting NIC to grant it a temporary IP Address', u'http://www.w3.org/2000/01/rdf-schema#commentThis NIC issued a DHCP to the requesting NIC', u'http://www.w3.org/2000/01/rdf-schema#commentDHCP assigns addresses to systems from a pool of assigned addresses. ', u'http://www.w3.org/2000/01/rdf-schema#labelcontrols assignment of', u'http://www.w3.org/2000/01/rdf-schema#commentwhen the lease expired', u'http://www.w3.org/2000/01/rdf-schema#labelissued lease', u'http://purl.org/dc/elements/1.1/#descriptionDescribes elements related to authentication mechanisms in systems that grant identity to users and requests to map them to privileges', u'http://www.w3.org/2000/01/rdf-schema#labelDHCP IP Address Pool', u'http://purl.org/dc/elements/1.1/#creatorInvincea Labs', u'http://www.w3.org/2000/01/rdf-schema#labelDynamic Host Control Protocol Ontology', u'http://www.w3.org/2000/01/rdf-schema#commentwhen the lease was granted', u'http://www.w3.org/2000/01/rdf-schema#commentthis address has been allocated to a DHCP Pool, and is not permanently assigned to any particular host', u'http://www.w3.org/2000/01/rdf-schema#labelDHCP Lease', u'http://www.w3.org/2000/01/rdf-schema#commentthe NIC (and therefore MAC) address this lease was issued by.']
=================================
here is the unique predicate object string
{0: u'http://www.w3.org/2000/01/rdf-schema#commentthe IP Address that was granted via a successful DHCP Lease', 1: u'http://www.w3.org/2000/01/rdf-schema#labelissued from', 2: u'http://www.w3.org/2000/01/rdf-schema#commentA Lease for a single IP Address from a DHCP Pool to a Network Interface on a Host', 3: u'http://www.w3.org/2000/01/rdf-schema#labelwas issued to', 4: u'http://www.w3.org/2000/01/rdf-schema#labellease ended on', 5: u'http://www.w3.org/2000/01/rdf-schema#labelbelongs to DHCP Pool', 6: u'http://www.w3.org/2000/01/rdf-schema#commentleases may identify themselves with a particular hostname, which may have its associated DNS Entry updated once the lease is granted. This is used extensively in Microsoft Active Directory', 7: u'http://www.w3.org/2000/01/rdf-schema#commentthis DHCP address pool is authoritative for this IP address, and controls leasing of it to client systems.', 8: u'http://purl.org/dc/elements/1.1/#date2014', 9: u'http://www.w3.org/2000/01/rdf-schema#labelfor address', 10: u'http://www.w3.org/2000/01/rdf-schema#labelwas granted lease', 11: u'http://www.invincea.com/ontologies/icas/1.0/tapio#signaturePriority1', 12: u'http://www.w3.org/2000/01/rdf-schema#commentan ontology of DHCP Leases and Services.', 13: u'http://www.w3.org/2002/07/owl#versionInfo1.0', 14: u'http://www.w3.org/2000/01/rdf-schema#labelfor hostname', 15: u'http://www.w3.org/2000/01/rdf-schema#commentthis NIC was successfully granted this DHC lease for an IP Address', 16: u'http://www.w3.org/2000/01/rdf-schema#commentthis lease was succesfully issued to a requesting NIC to grant it a temporary IP Address', 17: u'http://www.w3.org/2000/01/rdf-schema#commentThis NIC issued a DHCP to the requesting NIC', 18: u'http://www.w3.org/2000/01/rdf-schema#commentDHCP assigns addresses to systems from a pool of assigned addresses. ', 19: u'http://www.w3.org/2000/01/rdf-schema#labelcontrols assignment of', 20: u'http://www.w3.org/2000/01/rdf-schema#commentwhen the lease expired', 21: u'http://www.w3.org/2000/01/rdf-schema#labelissued lease', 22: u'http://purl.org/dc/elements/1.1/#descriptionDescribes elements related to authentication mechanisms in systems that grant identity to users and requests to map them to privileges', 23: u'http://www.w3.org/2000/01/rdf-schema#labelDHCP IP Address Pool', 24: u'http://purl.org/dc/elements/1.1/#creatorInvincea Labs', 25: u'http://www.w3.org/2000/01/rdf-schema#labelDynamic Host Control Protocol Ontology', 26: u'http://www.w3.org/2000/01/rdf-schema#commentwhen the lease was granted', 27: u'http://www.w3.org/2000/01/rdf-schema#commentthis address has been allocated to a DHCP Pool, and is not permanently assigned to any particular host', 28: u'http://www.w3.org/2000/01/rdf-schema#labelDHCP Lease', 29: u'http://www.w3.org/2000/01/rdf-schema#commentthe NIC (and therefore MAC) address this lease was issued by.'}
here is the subjectlist
[rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Pool'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseEnd'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseEnd'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseStart'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#fromAuthority'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#forAddress'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#fromAuthority'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#inPool'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leased'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Pool'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#forAddress'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Pool'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#issuedLease'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#issuedLease'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseStart'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#forAddress'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#inPool'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseStart'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#issuedLease'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#fromAuthority'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#forHostName'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leased'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedto'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leased'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseStart'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#fromAuthority'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#inPool'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedto'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#forAddress'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#forHostName'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#fromAuthority'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#forHostName'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseEnd'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedto'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leased'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#inPool'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedto'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#inPool'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseEnd'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedto'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#issuedLease')]
==========================
here is the objectlist
[rdflib.term.URIRef(u'http://www.bbn.com/ontologies/domain/foundation/mereology#Composite'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#FunctionalProperty'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#DatatypeProperty'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#FunctionalProperty'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#FunctionalProperty'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#Ontology'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#FunctionalProperty'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/nic#NIC'), rdflib.term.URIRef(u'http://www.bbn.com/ontologies/domain/foundation/mereology#partOf'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/nic#NIC'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#Thing'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#ObjectProperty'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#Class'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/ipnet'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#inPool'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/nic#NIC'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#fromAuthority'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/ipnet#Address'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/ipnet#Address'), rdflib.term.URIRef(u'http://www.bbn.com/ontologies/domain/foundation/mereology#hasPart'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#DatatypeProperty'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/ipnet#Address'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#ObjectProperty'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#ObjectProperty'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#ObjectProperty'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedTo'), rdflib.term.URIRef(u'http://www.w3.org/2001/XMLSchema#dateTimeStamp'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/user'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#ObjectProperty'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#ObjectProperty'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#ObjectProperty'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#Class'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#issuedLease'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/host#Host'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#InverseFunctionalProperty'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leased'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#Thing'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Pool'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/nic#NIC'), rdflib.term.URIRef(u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Pool'), rdflib.term.URIRef(u'http://www.w3.org/2001/XMLSchema#dateTimeStamp'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#FunctionalProperty'), rdflib.term.URIRef(u'http://www.w3.org/2002/07/owl#ObjectProperty')]
==========================
here is the subject-object dictionary
{0: u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Pool', 1: u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseEnd', 2: u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseStart', 3: u'http://www.invincea.com/ontologies/icas/1.0/dhcp#fromAuthority', 4: u'http://www.invincea.com/ontologies/icas/1.0/dhcp', 5: u'http://www.invincea.com/ontologies/icas/1.0/dhcp#forAddress', 6: u'http://www.invincea.com/ontologies/icas/1.0/dhcp#inPool', 7: u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leased', 8: u'http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress', 9: u'http://www.invincea.com/ontologies/icas/1.0/dhcp#issuedLease', 10: u'http://www.invincea.com/ontologies/icas/1.0/dhcp#forHostName', 11: u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedto', 12: u'http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease', 13: u'http://www.bbn.com/ontologies/domain/foundation/mereology#Composite', 14: u'http://www.w3.org/2002/07/owl#FunctionalProperty', 15: u'http://www.w3.org/2002/07/owl#DatatypeProperty', 16: u'http://www.w3.org/2002/07/owl#Ontology', 17: u'http://www.invincea.com/ontologies/icas/1.0/nic#NIC', 18: u'http://www.bbn.com/ontologies/domain/foundation/mereology#partOf', 19: u'http://www.w3.org/2002/07/owl#Thing', 20: u'http://www.w3.org/2002/07/owl#ObjectProperty', 21: u'http://www.w3.org/2002/07/owl#Class', 22: u'http://www.invincea.com/ontologies/icas/1.0/ipnet', 23: u'http://www.invincea.com/ontologies/icas/1.0/ipnet#Address', 24: u'http://www.bbn.com/ontologies/domain/foundation/mereology#hasPart', 25: u'http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedTo', 26: u'http://www.w3.org/2001/XMLSchema#dateTimeStamp', 27: u'http://www.invincea.com/ontologies/icas/1.0/user', 28: u'http://www.invincea.com/ontologies/icas/1.0/host#Host', 29: u'http://www.w3.org/2002/07/owl#InverseFunctionalProperty'}
the key is 0 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#forAddress
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#forAddress
k1 is: 5
the predobj is http://www.w3.org/2000/01/rdf-schema#commentthe IP Address that was granted via a successful DHCP Lease
k2 ks: 0
the key is 1 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#fromAuthority
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#fromAuthority
k1 is: 3
the predobj is http://www.w3.org/2000/01/rdf-schema#labelissued from
k2 ks: 1
the key is 2 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease
k1 is: 12
the predobj is http://www.w3.org/2000/01/rdf-schema#commentA Lease for a single IP Address from a DHCP Pool to a Network Interface on a Host
k2 ks: 2
the key is 3 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedto
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedto
k1 is: 11
the predobj is http://www.w3.org/2000/01/rdf-schema#labelwas issued to
k2 ks: 3
the key is 4 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseEnd
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseEnd
k1 is: 1
the predobj is http://www.w3.org/2000/01/rdf-schema#labellease ended on
k2 ks: 4
the key is 5 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#inPool
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#inPool
k1 is: 6
the predobj is http://www.w3.org/2000/01/rdf-schema#labelbelongs to DHCP Pool
k2 ks: 5
the key is 6 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#forHostName
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#forHostName
k1 is: 10
the predobj is http://www.w3.org/2000/01/rdf-schema#commentleases may identify themselves with a particular hostname, which may have its associated DNS Entry updated once the lease is granted. This is used extensively in Microsoft Active Directory
k2 ks: 6
the key is 7 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress
k1 is: 8
the predobj is http://www.w3.org/2000/01/rdf-schema#commentthis DHCP address pool is authoritative for this IP address, and controls leasing of it to client systems.
k2 ks: 7
the key is 8 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp
k1 is: 4
the predobj is http://purl.org/dc/elements/1.1/#date2014
k2 ks: 8
the key is 9 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#forAddress
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#forAddress
k1 is: 5
the predobj is http://www.w3.org/2000/01/rdf-schema#labelfor address
k2 ks: 9
the key is 10 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#leased
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#leased
k1 is: 7
the predobj is http://www.w3.org/2000/01/rdf-schema#labelwas granted lease
k2 ks: 10
the key is 11 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress
k1 is: 8
the predobj is http://www.invincea.com/ontologies/icas/1.0/tapio#signaturePriority1
k2 ks: 11
the key is 12 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseStart
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseStart
k1 is: 2
the predobj is http://www.w3.org/2000/01/rdf-schema#labellease ended on
k2 ks: 4
the key is 13 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp
k1 is: 4
the predobj is http://www.w3.org/2000/01/rdf-schema#commentan ontology of DHCP Leases and Services.
k2 ks: 12
the key is 14 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp
k1 is: 4
the predobj is http://www.w3.org/2002/07/owl#versionInfo1.0
k2 ks: 13
the key is 15 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#forHostName
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#forHostName
k1 is: 10
the predobj is http://www.w3.org/2000/01/rdf-schema#labelfor hostname
k2 ks: 14
the key is 16 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#leased
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#leased
k1 is: 7
the predobj is http://www.w3.org/2000/01/rdf-schema#commentthis NIC was successfully granted this DHC lease for an IP Address
k2 ks: 15
the key is 17 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedto
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#leasedto
k1 is: 11
the predobj is http://www.w3.org/2000/01/rdf-schema#commentthis lease was succesfully issued to a requesting NIC to grant it a temporary IP Address
k2 ks: 16
the key is 18 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#issuedLease
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#issuedLease
k1 is: 9
the predobj is http://www.w3.org/2000/01/rdf-schema#commentThis NIC issued a DHCP to the requesting NIC
k2 ks: 17
the key is 19 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#Pool
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#Pool
k1 is: 0
the predobj is http://www.w3.org/2000/01/rdf-schema#commentDHCP assigns addresses to systems from a pool of assigned addresses.
k2 ks: 18
the key is 20 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#containsAddress
k1 is: 8
the predobj is http://www.w3.org/2000/01/rdf-schema#labelcontrols assignment of
k2 ks: 19
the key is 21 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseEnd
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseEnd
k1 is: 1
the predobj is http://www.w3.org/2000/01/rdf-schema#commentwhen the lease expired
k2 ks: 20
the key is 22 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#issuedLease
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#issuedLease
k1 is: 9
the predobj is http://www.w3.org/2000/01/rdf-schema#labelissued lease
k2 ks: 21
the key is 23 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp
k1 is: 4
the predobj is http://purl.org/dc/elements/1.1/#descriptionDescribes elements related to authentication mechanisms in systems that grant identity to users and requests to map them to privileges
k2 ks: 22
the key is 24 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#Pool
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#Pool
k1 is: 0
the predobj is http://www.w3.org/2000/01/rdf-schema#labelDHCP IP Address Pool
k2 ks: 23
the key is 25 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp
k1 is: 4
the predobj is http://purl.org/dc/elements/1.1/#creatorInvincea Labs
k2 ks: 24
the key is 26 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp
k1 is: 4
the predobj is http://www.w3.org/2000/01/rdf-schema#labelDynamic Host Control Protocol Ontology
k2 ks: 25
the key is 27 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseStart
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#leaseStart
k1 is: 2
the predobj is http://www.w3.org/2000/01/rdf-schema#commentwhen the lease was granted
k2 ks: 26
the key is 28 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#inPool
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#inPool
k1 is: 6
the predobj is http://www.w3.org/2000/01/rdf-schema#commentthis address has been allocated to a DHCP Pool, and is not permanently assigned to any particular host
k2 ks: 27
the key is 29 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#Lease
k1 is: 12
the predobj is http://www.w3.org/2000/01/rdf-schema#labelDHCP Lease
k2 ks: 28
the key is 30 the subject is http://www.invincea.com/ontologies/icas/1.0/dhcp#fromAuthority
the subject is: http://www.invincea.com/ontologies/icas/1.0/dhcp#fromAuthority
k1 is: 3
the predobj is http://www.w3.org/2000/01/rdf-schema#commentthe NIC (and therefore MAC) address this lease was issued by.
k2 ks: 29
the rows is something
defaultdict(<type 'list'>, {0: [0, 0], 1: [1, 1], 2: [2, 2], 3: [3, 3], 4: [4, 4, 4, 4, 4, 4], 5: [5, 5], 6: [6, 6], 7: [7, 7], 8: [8, 8, 8], 9: [9, 9], 10: [10, 10], 11: [11, 11], 12: [12, 12]})
the cols is something
defaultdict(<type 'list'>, {0: [18, 23], 1: [4, 20], 2: [4, 26], 3: [1, 29], 4: [8, 12, 13, 22, 24, 25], 5: [0, 9], 6: [5, 27], 7: [10, 15], 8: [7, 11, 19], 9: [17, 21], 10: [6, 14], 11: [3, 16], 12: [2, 28]})
the length of the rows key is:
0
dim is:
30
dim2 is:
30
Traceback (most recent call last):
  File "extrescal.py", line 10, in <module>
    from loadDfromTTL2 import loadDfromTTL
  File "/home/brent/Downloads/Ext-RESCAL/loadDfromTTL2.py", line 148, in <module>
    loadDfromTTL('dhcp.ttl')
  File "/home/brent/Downloads/Ext-RESCAL/loadDfromTTL2.py", line 131, in loadDfromTTL
    D = coo_matrix((ones(daones),(rows[0],cols[0])),shape=(dim,dim2),dtype=np.uint8).tocsr()
  File "/usr/local/lib/python2.7/dist-packages/scipy/sparse/coo.py", line 191, in __init__
    self._check()
  File "/usr/local/lib/python2.7/dist-packages/scipy/sparse/coo.py", line 235, in _check
    if self.nnz > 0:
  File "/usr/local/lib/python2.7/dist-packages/scipy/sparse/base.py", line 221, in nnz
    return self.getnnz()
  File "/usr/local/lib/python2.7/dist-packages/scipy/sparse/coo.py", line 197, in getnnz
    raise ValueError('row, column, and data array must all be the '
ValueError: row, column, and data array must all be the same lengt

Saturday, July 7, 2018

optical character recognition for smartphones

Optical Character Recognition for iOS

https://www.heatware.net/ruby-rails/how-to-install-rubygems-linux-ubuntu-10/

https://stackoverflow.com/questions/14202255/pod-install-bash-pod-command-not-found

http://guides.cocoapods.org/using/the-podfile.html

http://guides.cocoapods.org/using/the-podfile.html

Optical Character Recognition for Android
https://acadgild.com/blog/how-to-perform-optical-character-recognition-in-android

Wednesday, June 20, 2018

Revisiting Brents Ext Rescal modifications

Source : https://github.com/bshambaugh/Brents-Ext_RESCAL 
(copied from : https://github.com/nzhiltsov/Ext-RESCAL)

python extrescal.py --latent 2 --lmbda 0.001 --input tiny-mixed-example 
--outputentities entity.embeddings.csv --outputterms term.embeddings.csv 
--outputfactors latent.factors.csv --log extrescal.log

loads loadXfromTTL.py

but not and


loadDfromTTL2.py

Tuesday, May 22, 2018

Running Nose Tests in Python

Start of running tests with nose in Python.

https://nose.readthedocs.io/en/latest/usage.html

We can use nose to run one of the tests from Ext-Rescal:

nosetests extrescalFunctionsTest.py



Sunday, May 13, 2018

Getting the D matrix in Ext-Rescal

Theory::

To get a D matrix in Ext-Rescal [1,2], we need to check whether the objects are strings [3].

[1] https://github.com/nzhiltsov/Ext-RESCAL
[2] "Factorizing YAGO"
http://www.dbs.ifi.lmu.de/%7Etresp/papers/p271.pdf

[3] https://stackoverflow.com/questions/25259134/how-can-i-check-whether-a-url-is-valid-using-urlparse

Friday, May 4, 2018

Looking at Ext-RESCAL Xk prediction w.r.t. won tensor-util

In my previous blog post "Notes for Ext-Rescal (may 3rd)"[1] I talked about:

Xk = A*R*A.T where A*R*A.T is a prediction for Xk .

Today I am going to use a utility from the Web of Needs to (attempt to) verify this assumption.

tensor-utils.py in won-matcher-rescal/../python/tools/ contains lines 240 to 262. Line 240 states
"
TESTING METHOD for rescal algorithm output predict hints"

Line 244 states

# - threshold: write out only those predictions that are above the threshold

Line 249 to 250 show how to create predictions.

# compute prediction array with scores
hint_prediction_matrix = np.dot(A,np.dot(R[SparseTensor.CONNECTION_SLICE], A.T))

Following numpy documentation, numpy.dot is for a 2-D array
"If both a and b are 2-D arrays, it is matrix multiplication, but using matmul or a @ b is preferred."


I also guessed that SparseTensor.CONNECTION_SLICE was 0. A short python program derived from lines 29 and 31 verifies this.

class SparseTensor:
   CONNECTION_SLICE = 0

print SparseTensor.CONNECTION_SLICE






>> 0

A short program to implement lines 249 to 250 would be:

import numpy as np

 A = np.array([[-0.70710678, 0.70710678], [ 0.52943053, 0.52943053], [ 0.52943053, 0.52943053],[ 0.00206809, 0.00206809]])

R = np.array([np.array([[  5.47627165e-01,  -1.16883182e-16],[ -6.07013365e-17,   1.29500171e-32]]), np.array([[  1.06958431e-03,  -1.65920612e-19], [ -2.28287465e-19,   3.54015545e-35]]), np.array([[  1.74139035e-33,   5.09236793e-17], [  5.09233343e-17,   1.47866314e+00]])])

hint_prediction_matrix = np.dot(A,np.dot(R[0], A.T))


Lines 252 to 253:
# choose indices above threshold to keep
hint_indices = hint_prediction_matrix > threshold

This is like the first paragraph describing theta in "4.4 Solving Relational Learning Tasks" in
M. Nickel et al., "A Three-Way Model for Collective Learning on Multi-Relational Data"

A short program to implement lines 252 to 253 would be:

threshold = 5.99602451e-04
hint_indices = hint_prediction_matrix > threshold

print hint_indices
>> array([[ True, False, False, False],
       [False,  True,  True, False],
       [False,  True,  True, False],
       [False, False, False, False]], dtype=bool)

Lines 252 to 257:

   # choose indices above threshold to keep
    hint_indices = hint_prediction_matrix > threshold
    if not keepScore:
        hint_prediction_matrix[hint_indices] = 1
    hint_mask_matrix = np.zeros(hint_prediction_matrix.shape)
    hint_mask_matrix[hint_indices] = 1




A short program to implement lines 252 to 257 would be:
#if not keepScore:
#       hint_prediction_matrix[hint_indices] = 1
hint_mask_matrix = np.zeros(hint_prediction_matrix.shape)
hint_mask_matrix[hint_indices] = 1

print hint_indices
print hint_mask_matrix

I am not sure what lines253 and 254 do, so I commented them out (keepScore = True or keepScore=False) and got the same result...



















Matching data with sparql queries for tiny-mixed-example in Ext-Rescal

(1) Create turtle data:

@prefix dbr: <http://dbpedia.org/resource/> .
@prefix : <http://example.org/> .
dbr:Vibeke :member-of dbr:Tristania .
dbr:Morten :member-of dbr:Tristania .
dbr:Tristania :genre dbr:Metal .
:author1 :cites :author1 .
:author2 :cites :author1 .
:author2 :cites :author2 .

(2) Load data into Blazegraph with a sparql update.


(2) Find all distinct predicates

SELECT DISTINCT ?p
WHERE { ?s ?p ?o . }


<http://example.org/cites>
<http://example.org/genre>
<http://example.org/member-of>

(2a.r) Select the subjects as rows  for  :member-of


SELECT ?s
WHERE { ?s <http://example.org/member-of> ?o . }

s
<http://dbpedia.org/resource/Morten>      === > 2
<http://dbpedia.org/resource/Vibeke>      === > 1 


Check:
Matches  1-rows in tiny-mixed-example:
1 2

(2a.c)  Select the objects as columns  for  :member-of


SELECT ?o
WHERE { ?s <http://example.org/member-of> ?o . }

<http://dbpedia.org/resource/Tristania>  === > 0
<http://dbpedia.org/resource/Tristania>   === > 0



Check:
Matches  1-cols in tiny-mixed-example:
0 0

(2b.r) Select the subjects as rows  for  :genre


SELECT  ?s
WHERE { ?s <http://example.org/genre> ?o . }

<http://dbpedia.org/resource/Tristania>  ==> 0

Check:
Matches  2-rows in tiny-mixed-example:
0

(2b.c) Select the objects as rows  for  :genre

SELECT  ?o
WHERE { ?s <http://example.org/genre> ?o . }

<http://dbpedia.org/resource/Metal>  ==> 3


Check:
Matches  2-cols in tiny-mixed-example:
0

(2c.r) Select the subjects as rows  for  :cites

SELECT  ?s
WHERE { ?s <http://example.org/cites> ?o . }

<http://example.org/author1>  ==> 4
<http://example.org/author2>  ==> 5
<http://example.org/author2>  ==> 5

Check:
Matches  3-rows in tiny-mixed-example:
4 5 5


(2c.c) Select the objects as rows  for  :cites

SELECT  ?o
WHERE { ?s <http://example.org/cites> ?o . }

<http://example.org/author1>   ==> 4
<http://example.org/author1>   ==> 4
<http://example.org/author2>   ==> 5


Check:
Matches  3-cols in tiny-mixed-example:
4 4 5