Skip to content

Commit

Permalink
upgade ontology version
Browse files Browse the repository at this point in the history
  • Loading branch information
ManoelMilchev committed Feb 29, 2024
1 parent 93df9cb commit 999be45
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 25 deletions.
26 changes: 2 additions & 24 deletions concordances/cypher.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
)

const thingURL = "http://api.ft.com/things/"
const systemURL = "http://api.ft.com/system/"

// Driver interface
type Driver interface {
Expand All @@ -32,11 +31,6 @@ func NewCypherDriver(driver *cmneo4j.Driver, publicAPIURL string) (CypherDriver,
return CypherDriver{}, err
}

conceptTypes := ontology.GetConfig().GetExternalAuthorities()
for _, conceptType := range conceptTypes {
authorityMap[conceptType] = systemURL + conceptType
}

return CypherDriver{driver, publicAPIURL}, nil
}

Expand Down Expand Up @@ -264,24 +258,8 @@ func neoReadStructToConcordances(neo []neoReadStruct, baseURL string) (Concordan
return concordances, nil
}

// Map of authority to URI for the supported concordance IDs
var authorityMap = map[string]string{
"TME": "http://api.ft.com/system/FT-TME",
"FACTSET": "http://api.ft.com/system/FACTSET",
"UPP": "http://api.ft.com/system/UPP",
"LEI": "http://api.ft.com/system/LEI",
"Smartlogic": "http://api.ft.com/system/SMARTLOGIC",
"ManagedLocation": "http://api.ft.com/system/MANAGEDLOCATION",
"ISO-3166-1": "http://api.ft.com/system/ISO-3166-1",
"Geonames": "http://api.ft.com/system/GEONAMES",
"Wikidata": "http://api.ft.com/system/WIKIDATA",
"DBPedia": "http://api.ft.com/system/DBPEDIA",
"NAICS": "http://api.ft.com/system/NAICS",
"FTAnI": "http://api.ft.com/system/FT-AnI",
}

func AuthorityFromURI(uri string) (string, bool) {
for a, u := range authorityMap {
for a, u := range ontology.GetConfig().GetAuthoritiesURIMap() {
if u == uri {
return a, true
}
Expand All @@ -290,7 +268,7 @@ func AuthorityFromURI(uri string) (string, bool) {
}

func AuthorityToURI(authority string) (string, bool) {
authorityURI, found := authorityMap[authority]
authorityURI, found := ontology.GetConfig().GetAuthoritiesURIMap()[authority]
return authorityURI, found
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ toolchain go1.21.2

require (
github.com/Financial-Times/api-endpoint v1.0.0
github.com/Financial-Times/cm-graph-ontology/v2 v2.0.5
github.com/Financial-Times/cm-graph-ontology/v2 v2.0.6
github.com/Financial-Times/cm-neo4j-driver v1.1.1
github.com/Financial-Times/go-fthealth v0.0.0-20171204124831-1b007e2b37b7
github.com/Financial-Times/go-logger/v2 v2.0.1
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ github.com/Financial-Times/api-endpoint v1.0.0 h1:EhJfcVcrktPrweue6dCUQAYcEQiXwh
github.com/Financial-Times/api-endpoint v1.0.0/go.mod h1:QrJsxP8uEZIPJZon+qhc+zO7H0634DpoqDI291i0Nag=
github.com/Financial-Times/cm-graph-ontology/v2 v2.0.5 h1:KfUnzb4W4nqol1HjSZ95Qc9jUg6l+JmANaypXJkJBqQ=
github.com/Financial-Times/cm-graph-ontology/v2 v2.0.5/go.mod h1:6Y6A7CSTLrH5An3FIP3j3c0ZQrsCDcOI/8SkkJEsOLg=
github.com/Financial-Times/cm-graph-ontology/v2 v2.0.6-0.20240229075048-0ebf1097d18f h1:+QPawy296AwXFfVRJ70j79ynn7inE48dtjl9QIDSMvA=
github.com/Financial-Times/cm-graph-ontology/v2 v2.0.6-0.20240229075048-0ebf1097d18f/go.mod h1:6Y6A7CSTLrH5An3FIP3j3c0ZQrsCDcOI/8SkkJEsOLg=
github.com/Financial-Times/cm-graph-ontology/v2 v2.0.6 h1:J9NYUCVisbQK8ISSNY+Eek0FORJRhizlBfg+XDkDURo=
github.com/Financial-Times/cm-graph-ontology/v2 v2.0.6/go.mod h1:6Y6A7CSTLrH5An3FIP3j3c0ZQrsCDcOI/8SkkJEsOLg=
github.com/Financial-Times/cm-neo4j-driver v1.1.1 h1:kmgRa3boe58+tzNTbWTBx3IQnIZt5Hh57Yc2kHy85FM=
github.com/Financial-Times/cm-neo4j-driver v1.1.1/go.mod h1:fQ77C8A+6I+ihwe6Ob8Y7sIzU3s/DTrjBZJGVQOeum0=
github.com/Financial-Times/go-fthealth v0.0.0-20171204124831-1b007e2b37b7 h1:dkf1EOTiHXA2lG2EJuePEim6y0HEOPt0hcqsT/qUr/k=
Expand Down

0 comments on commit 999be45

Please sign in to comment.