-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakeSakaiDetail.js
More file actions
59 lines (51 loc) · 2.15 KB
/
makeSakaiDetail.js
File metadata and controls
59 lines (51 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { GBizINFO } from "./GBizINFO.js";
//import { CSV } from "https://js.sabae.cc/CSV.js";
const gbiz = new GBizINFO();
const cid = "6120001005484"; // sharp
// const cid = "3011101077122"; // B Inc.
const data = await gbiz.getDetail(cid);
console.log(data);
/*
// 基本
PREFIX hj: <http://hojin-info.go.jp/ns/domain/biz/1#>
PREFIX ic: <http://imi.go.jp/ns/core/rdf#>
SELECT DISTINCT ?corporateID ?corporateName ?corporateKana ?location ?moddate ?systemName ?classSInfo
FROM <http://hojin-info.go.jp/graph/hojin> {
?s hj:法人基本情報 ?key.
?key ic:ID/ic:識別値 '6120001005484'.
OPTIONAL{?key ic:ID/ic:識別値 ?corporateID .}
OPTIONAL{?key ic:名称 _:keyCorporateName .
_:keyCorporateName ic:種別 '商号又は名称'.
_:keyCorporateName ic:表記 ?corporateName .}
OPTIONAL{?key ic:名称 _:keyCorporateNameKana .
_:keyCorporateNameKana ic:種別 '商号又は名称'.
_:keyCorporateNameKana ic:カナ表記 ?corporateKana .}
OPTIONAL{?key ic:住所 _:keyAddress .
_:keyAddress ic:種別 '住所' .
_:keyAddress ic:表記 ?location .}
OPTIONAL{?key hj:更新日時/ic:標準型日時 ?moddate .}
OPTIONAL{?key hj:システム名/ic:表記 ?systemName .}
OPTIONAL{?key hj:区分 _:keyStatus.
_:keyStatus ic:種別 '処理区分'.
_:keyStatus ic:表記 ?classSInfo .}
} GROUP BY ?corporateID ?corporateName ?corporateKana ?location ?moddate ?systemName ?classSInfo
// 詳しい情報をとりたい
https://info.gbiz.go.jp/hojin/ichiran?hojinBango=6120001005484
*/
/*
const data = await gbiz.getCityIDs("大阪府", "堺市");
const res = [];
const basecode = 27140;
for (const d of data) {
//const code = 18207; // 鯖江市
const code = d.code;
const data = await gbiz.getBasicByCityID(code);
data.sort(gbiz.filterByCorporateID);
data.forEach(d => res.push(d));
console.log(d.cityname, data.length);
//console.log(JSON.stringify(data, null, 2), data?.length);
}
console.log(res.length);
await Deno.mkdir("data/" + basecode, { recursive: true });
await Deno.writeTextFile("data/" + basecode + "/company.csv", CSV.stringify(res));
*/