Skip to content

denysvitali/zefix-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zefix-tools

A collection of tools to interact with the data exported by Zefix, the Swiss Central Business Name Index.

Get the data

Use sparql-client to query the data from the Zefix SPARQL endpoint and generate a JSON file.

go install github.com/denysvitali/sparql-client/cmd/sparql-client@master
sparql-client --endpoint https://register.ld.admin.ch/query \
    --query query.txt \
    -a -D \
    --limit 500 \
    -o zefix.json

Import the data

Start PostgreSQL

docker-compose up -d

Get the container IP

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker-compose ps -q | head -n1)

Once you have the IP, you can add it to ZEFIX_DSN in .env

Import the data to postgres

source .env
export ZEFIX_DSN
# This will take a while:
go run ./cmd/zefix-import --input ./zefix.json

Query the data

source .env
export ZEFIX_DSN
go run ./cmd/zefix-find "Rega AG"                                                                                           [23:39:51]

will result in:

Name: Rega AG
URI: https://register.ld.admin.ch/zefix/company/144424

About

A collection of tools to interact with the data exported by Zefix, the Swiss Central Business Name Index

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages