arelle-release 2.37.33__py3-none-any.whl → 2.37.35__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of arelle-release might be problematic. Click here for more details.

@@ -438,7 +438,7 @@ class DisclosureSystem:
438
438
  return href in self.standardTaxonomiesDict
439
439
  return True # no standard taxonomies to test
440
440
 
441
- def hrefValidForDisclosureSystem(self, href):
441
+ def hrefValidForDisclosureSystem(self, href) -> bool:
442
442
  if self.validTaxonomiesUrl:
443
443
  return href in self.validTaxonomiesDict
444
444
  elif self.standardTaxonomiesUrl: # fallback to standard taxonomies dict
arelle/ModelValue.py CHANGED
@@ -35,11 +35,11 @@ def qname(value: ModelObject | str | QName, name: str | ModelObject | None = Non
35
35
  def qname(value: ModelObject, name: QName, noPrefixIsNoNamespace: bool) -> QName: ...
36
36
 
37
37
  @overload
38
- def qname(value: ModelObject | str | QName | Any | None, name: str | ModelObject | dict[str, str] | None) -> QName | None : ...
38
+ def qname(value: ModelObject | str | QName | Any | None, name: str | ModelObject | dict[str, str] | dict[str | None, str] | None) -> QName | None : ...
39
39
 
40
40
  def qname(
41
41
  value: ModelObject | str | QName | Any | None,
42
- name: str | QName | ModelObject | dict[str, str] | None = None,
42
+ name: str | QName | ModelObject | dict[str, str] | dict[str | None, str] | None = None,
43
43
  noPrefixIsNoNamespace: bool = False,
44
44
  castException: Exception | None = None,
45
45
  prefixException: Exception | None = None,
@@ -66,6 +66,7 @@ def qname(
66
66
  elif not isinstance(value, str):
67
67
  if castException: raise castException
68
68
  return None
69
+ namespaceDict: dict[str | None, str] | None
69
70
  if value and value[0] == '{': # clark notation (with optional prefix)
70
71
  namespaceURI,sep,prefixedLocalName = value[1:].rpartition('}')
71
72
  prefix: str | None
@@ -85,7 +86,7 @@ def qname(
85
86
  else:
86
87
  if isinstance(name, dict):
87
88
  namespaceURI = None
88
- namespaceDict = name # note that default prefix must be None, not '', in dict
89
+ namespaceDict = cast(dict[str | None, str], name) # note that default prefix must be None, not '', in dict
89
90
  elif name is not None:
90
91
  if name: # len > 0
91
92
  namespaceURI = value
arelle/XbrlConst.py CHANGED
@@ -21,17 +21,22 @@ _tuple = tuple # type: ignore[type-arg]
21
21
 
22
22
  xsd = "http://www.w3.org/2001/XMLSchema"
23
23
  qnXsdComplexType = qname("{http://www.w3.org/2001/XMLSchema}xsd:complexType")
24
+ qnXsdDocumentation = qname("{http://www.w3.org/2001/XMLSchema}xsd:documentation")
25
+ qnXsdImport = qname("{http://www.w3.org/2001/XMLSchema}xsd:import")
24
26
  qnXsdSchema = qname("{http://www.w3.org/2001/XMLSchema}xsd:schema")
25
27
  qnXsdAppinfo = qname("{http://www.w3.org/2001/XMLSchema}xsd:appinfo")
26
28
  qnXsdDefaultType = qname("{http://www.w3.org/2001/XMLSchema}xsd:anyType")
27
29
  xsi = "http://www.w3.org/2001/XMLSchema-instance"
28
30
  qnXsiNil = qname(xsi, "xsi:nil") # need default prefix in qname
31
+ qnXsiType = qname(xsi, "xsi:type")
32
+ qnXsiSchemaLocation = qname(xsi, "xsi:schemaLocation")
33
+ qnXsiNoNamespaceSchemaLocation = qname(xsi, "xsi:noNamespaceSchemaLocation")
29
34
  qnXmlLang = qname("{http://www.w3.org/XML/1998/namespace}xml:lang")
30
35
  builtinAttributes = {
31
36
  qnXsiNil,
32
- qname(xsi, "xsi:type"),
33
- qname(xsi, "xsi:schemaLocation"),
34
- qname(xsi, "xsi:noNamespaceSchemaLocation"),
37
+ qnXsiType,
38
+ qnXsiSchemaLocation,
39
+ qnXsiNoNamespaceSchemaLocation,
35
40
  }
36
41
  xml = "http://www.w3.org/XML/1998/namespace"
37
42
  xbrli = "http://www.xbrl.org/2003/instance"
arelle/_version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '2.37.33'
21
- __version_tuple__ = version_tuple = (2, 37, 33)
20
+ __version__ = version = '2.37.35'
21
+ __version_tuple__ = version_tuple = (2, 37, 35)
@@ -0,0 +1,12 @@
1
+ """
2
+ See COPYRIGHT.md for copyright information.
3
+ """
4
+ from arelle.ModelValue import qname
5
+
6
+ qnEdinetManifestInsert = qname("{http://disclosure.edinet-fsa.go.jp/2013/manifest}insert")
7
+ qnEdinetManifestInstance = qname("{http://disclosure.edinet-fsa.go.jp/2013/manifest}instance")
8
+ qnEdinetManifestItem = qname("{http://disclosure.edinet-fsa.go.jp/2013/manifest}item")
9
+ qnEdinetManifestIxbrl = qname("{http://disclosure.edinet-fsa.go.jp/2013/manifest}ixbrl")
10
+ qnEdinetManifestList = qname("{http://disclosure.edinet-fsa.go.jp/2013/manifest}list")
11
+ qnEdinetManifestTitle = qname("{http://disclosure.edinet-fsa.go.jp/2013/manifest}title")
12
+ qnEdinetManifestTocComposition = qname("{http://disclosure.edinet-fsa.go.jp/2013/manifest}tocComposition")
@@ -0,0 +1,124 @@
1
+ """
2
+ See COPYRIGHT.md for copyright information.
3
+ """
4
+ from __future__ import annotations
5
+
6
+ import zipfile
7
+ from dataclasses import dataclass
8
+ from functools import lru_cache
9
+ from pathlib import Path
10
+
11
+ from lxml import etree
12
+ from lxml.etree import _Element
13
+
14
+ from arelle import XbrlConst
15
+ from arelle.FileSource import FileSource
16
+ from arelle.ModelValue import QName, qname
17
+ from . import Constants
18
+
19
+
20
+ @dataclass(frozen=True)
21
+ class Manifest:
22
+ instances: list[ManifestInstance]
23
+ path: Path
24
+ titlesByLang: dict[str, str]
25
+ tocItems: list[ManifestTocItem]
26
+
27
+
28
+ @dataclass(frozen=True)
29
+ class ManifestTocItem:
30
+ extrole: str
31
+ childItems: list[ManifestTocItem]
32
+ itemIn: str
33
+ parent: QName | None
34
+ ref: str
35
+ start: QName | None
36
+
37
+
38
+ @dataclass(frozen=True)
39
+ class ManifestInstance:
40
+ id: str
41
+ ixbrlFiles: list[Path]
42
+ preferredFilename: str
43
+ type: str
44
+
45
+
46
+ def _parseManifestTocItems(parentElt: _Element, parentQName: QName | None) -> list[ManifestTocItem]:
47
+ tocItems = []
48
+ for itemElt in parentElt.iterchildren(tag=Constants.qnEdinetManifestItem.clarkNotation):
49
+ childTocItems = []
50
+ for insertElt in itemElt.iterchildren(tag=Constants.qnEdinetManifestInsert.clarkNotation):
51
+ childParentQName = qname(insertElt.attrib.get("parent"), insertElt.nsmap) if insertElt.attrib.get("parent") else None
52
+ childTocItems.extend(_parseManifestTocItems(insertElt, childParentQName))
53
+ tocItems.append(ManifestTocItem(
54
+ extrole=itemElt.attrib.get("extrole", ""),
55
+ childItems=childTocItems,
56
+ parent=parentQName,
57
+ itemIn=itemElt.attrib.get("in", ""),
58
+ ref=itemElt.attrib.get("ref", ""),
59
+ start=qname(itemElt.attrib.get("start"), itemElt.nsmap) if itemElt.attrib.get("start") else None,
60
+ ))
61
+ return tocItems
62
+
63
+
64
+ def _parseManifestDoc(xmlRootElement: _Element, path: Path) -> Manifest:
65
+ instances = []
66
+ titlesByLang = {}
67
+ base = path.parent
68
+ tocElts = list(xmlRootElement.iterchildren(tag=Constants.qnEdinetManifestTocComposition.clarkNotation))
69
+ assert len(tocElts) == 1, 'There should be exactly one tocComposition element in the manifest.'
70
+ for titleElt in tocElts[0].iterchildren(tag=Constants.qnEdinetManifestTitle.clarkNotation):
71
+ lang = titleElt.attrib.get(XbrlConst.qnXmlLang.clarkNotation, "")
72
+ titlesByLang[lang] = titleElt.text.strip() if titleElt.text else ""
73
+ tocItems = _parseManifestTocItems(tocElts[0], None)
74
+ listElts = list(xmlRootElement.iterchildren(tag=Constants.qnEdinetManifestList.clarkNotation))
75
+ assert len(listElts) == 1, 'There should be exactly one list element in the manifest.'
76
+ for instanceElt in listElts[0].iterchildren(tag=Constants.qnEdinetManifestInstance.clarkNotation):
77
+ instanceId = str(instanceElt.attrib.get("id", ""))
78
+ instanceType = str(instanceElt.attrib.get("type", ""))
79
+ preferredFilename = str(instanceElt.attrib.get("preferredFilename", ""))
80
+ ixbrlFiles = []
81
+ for ixbrlElt in instanceElt.iterchildren(tag=Constants.qnEdinetManifestIxbrl.clarkNotation):
82
+ uri = ixbrlElt.text.strip() if ixbrlElt.text is not None else None
83
+ if uri is not None and len(uri) > 0:
84
+ ixbrlFiles.append(base / uri)
85
+ instances.append(ManifestInstance(
86
+ id=instanceId,
87
+ ixbrlFiles=ixbrlFiles,
88
+ preferredFilename=preferredFilename,
89
+ type=instanceType,
90
+ ))
91
+ return Manifest(
92
+ instances=instances,
93
+ path=path,
94
+ titlesByLang=titlesByLang,
95
+ tocItems=tocItems,
96
+ )
97
+
98
+
99
+ @lru_cache(1)
100
+ def parseManifests(filesource: FileSource) -> list[Manifest]:
101
+ manifests: list[Manifest] = []
102
+ if filesource.isArchive:
103
+ if filesource.isTaxonomyPackage:
104
+ return manifests
105
+ if filesource.reportPackage is not None:
106
+ return manifests
107
+ for _archiveFile in (filesource.dir or ()):
108
+ if not Path(_archiveFile).stem.startswith('manifest'):
109
+ continue
110
+ assert isinstance(filesource.fs, zipfile.ZipFile), \
111
+ "The EDINET plugin only supports archives in .zip format."
112
+ with filesource.fs.open(_archiveFile) as manifestDoc:
113
+ xmlRootElement = etree.fromstring(manifestDoc.read())
114
+ manifests.append(_parseManifestDoc(xmlRootElement, Path(_archiveFile)))
115
+ elif (dirpath := Path(str(filesource.url))).is_dir():
116
+ for file in dirpath.rglob("*"):
117
+ if not file.is_file():
118
+ continue
119
+ if not file.stem.startswith('manifest'):
120
+ continue
121
+ with open(file, 'rb') as manifestDoc:
122
+ xmlRootElement = etree.fromstring(manifestDoc.read())
123
+ manifests.append(_parseManifestDoc(xmlRootElement, file))
124
+ return manifests
@@ -131,3 +131,6 @@ class PluginValidationDataExtension(PluginData):
131
131
  )
132
132
  return False
133
133
  return True
134
+
135
+ def isStandardTaxonomyUrl(self, uri: str, modelXbrl: ModelXbrl) -> bool:
136
+ return modelXbrl.modelManager.disclosureSystem.hrefValidForDisclosureSystem(uri)
@@ -5,21 +5,28 @@ See COPYRIGHT.md for copyright information.
5
5
  """
6
6
  from __future__ import annotations
7
7
 
8
- import zipfile
9
8
  from collections import defaultdict
10
9
  from pathlib import Path
11
10
  from typing import Any
12
11
 
13
- from lxml import etree
14
- from lxml.etree import _Element
15
-
16
12
  from arelle.FileSource import FileSource
13
+ from arelle.ModelXbrl import ModelXbrl
17
14
  from arelle.Version import authorLabel, copyrightLabel
15
+ from . import Constants
16
+ from .Manifest import Manifest, ManifestInstance, parseManifests
18
17
  from .ValidationPluginExtension import ValidationPluginExtension
19
- from .rules import upload
18
+ from .rules import edinet, frta, gfm, upload
20
19
 
21
20
  PLUGIN_NAME = "Validate EDINET"
22
21
  DISCLOSURE_SYSTEM_VALIDATION_TYPE = "EDINET"
22
+ RELEVELER_MAP: dict[str, dict[str, tuple[str, str | None]]] = {
23
+ "ERROR": {
24
+ # Silence, duplicated by EDINET.EC5002E
25
+ "xbrl.4.8.2:sharesFactUnit-notSharesMeasure": ("ERROR", None),
26
+ # Silence, duplicated by EDINET.EC5002E
27
+ "xbrl.4.8.2:sharesFactUnit-notSingleMeasure": ("ERROR", None),
28
+ },
29
+ }
23
30
 
24
31
 
25
32
  validationPlugin = ValidationPluginExtension(
@@ -27,6 +34,9 @@ validationPlugin = ValidationPluginExtension(
27
34
  disclosureSystemConfigUrl=Path(__file__).parent / "resources" / "config.xml",
28
35
  validationTypes=[DISCLOSURE_SYSTEM_VALIDATION_TYPE],
29
36
  validationRuleModules=[
37
+ edinet,
38
+ frta,
39
+ gfm,
30
40
  upload,
31
41
  ],
32
42
  )
@@ -40,56 +50,27 @@ def disclosureSystemConfigURL(*args: Any, **kwargs: Any) -> str:
40
50
  return validationPlugin.disclosureSystemConfigURL
41
51
 
42
52
 
43
- def _parseManifestDoc(xmlRootElement: _Element, base: Path) -> dict[str, list[Path]]:
44
- sets = defaultdict(list)
45
- for instanceElt in xmlRootElement.iter(tag="{http://disclosure.edinet-fsa.go.jp/2013/manifest}instance"):
46
- instanceId = str(instanceElt.attrib["id"])
47
- for ixbrlElt in instanceElt.iter(tag="{http://disclosure.edinet-fsa.go.jp/2013/manifest}ixbrl"):
48
- uri = ixbrlElt.text.strip() if ixbrlElt.text is not None else None
49
- if uri:
50
- sets[instanceId].append(base / uri)
51
- return sets
52
-
53
-
54
53
  def fileSourceEntrypointFiles(filesource: FileSource, inlineOnly: bool, *args: Any, **kwargs: Any) -> list[dict[str, Any]] | None:
55
- manifests = {}
56
- if filesource.isArchive:
57
- if filesource.isTaxonomyPackage:
58
- return None
59
- if filesource.reportPackage is not None:
60
- return None
61
- for _archiveFile in (filesource.dir or ()):
62
- if not Path(_archiveFile).stem.startswith('manifest'):
63
- continue
64
- assert isinstance(filesource.fs, zipfile.ZipFile), \
65
- "The EDINET plugin only supports archives in .zip format."
66
- with filesource.fs.open(_archiveFile) as manifestDoc:
67
- base = Path(_archiveFile).parent
68
- xmlRootElement = etree.fromstring(manifestDoc.read())
69
- manifests.update(_parseManifestDoc(xmlRootElement, base))
70
- elif (dirpath := Path(str(filesource.url))).is_dir():
71
- for file in dirpath.rglob("*"):
72
- if not file.is_file():
73
- continue
74
- if not file.stem.startswith('manifest'):
75
- continue
76
- with open(file, 'rb') as manifestDoc:
77
- base = file.parent
78
- xmlRootElement = etree.fromstring(manifestDoc.read())
79
- manifests.update(_parseManifestDoc(xmlRootElement, base))
54
+ manifests = parseManifests(filesource)
80
55
  if len(manifests) == 0:
81
56
  return None
82
-
83
57
  entrypointFiles = []
84
- for instanceId, uris in manifests.items():
85
- entrypoints = []
86
- for uri in uris:
87
- filesource.select(str(uri))
88
- entrypoints.append({"file": filesource.url})
89
- entrypointFiles.append({'ixds': entrypoints})
58
+ for manifest in manifests:
59
+ for instance in manifest.instances:
60
+ entrypoints = []
61
+ for ixbrlFile in instance.ixbrlFiles:
62
+ filesource.select(str(ixbrlFile))
63
+ entrypoints.append({"file": filesource.url})
64
+ entrypointFiles.append({'ixds': entrypoints})
90
65
  return entrypointFiles
91
66
 
92
67
 
68
+ def loggingSeverityReleveler(modelXbrl: ModelXbrl, level: str, messageCode: str, args: Any, **kwargs: Any) -> tuple[str | None, str | None]:
69
+ if level in RELEVELER_MAP:
70
+ return RELEVELER_MAP[level].get(messageCode, (level, messageCode))
71
+ return level, messageCode
72
+
73
+
93
74
  def modelXbrlLoadComplete(*args: Any, **kwargs: Any) -> None:
94
75
  return validationPlugin.modelXbrlLoadComplete(*args, **kwargs)
95
76
 
@@ -113,6 +94,7 @@ __pluginInfo__ = {
113
94
  "DisclosureSystem.Types": disclosureSystemTypes,
114
95
  "DisclosureSystem.ConfigURL": disclosureSystemConfigURL,
115
96
  "FileSource.EntrypointFiles": fileSourceEntrypointFiles,
97
+ "Logging.Severity.Releveler": loggingSeverityReleveler,
116
98
  "ModelXbrl.LoadComplete": modelXbrlLoadComplete,
117
99
  "Validate.XBRL.Finally": validateXbrlFinally,
118
100
  "ValidateFormula.Finished": validateFinally,
@@ -6,7 +6,9 @@
6
6
  <DisclosureSystem
7
7
  names="EDINET|edinet"
8
8
  description="Checks for EDINET."
9
+ blockDisallowedReferences="true"
9
10
  validationType="EDINET"
11
+ validTaxonomiesUrl="edinet-taxonomies.xml"
10
12
  exclusiveTypesPattern="EFM|GFM|FERC|HMRC|SBR.NL|EBA|EIOPA|ESEF"
11
13
  />
12
14
  </DisclosureSystems>
@@ -0,0 +1,60 @@
1
+ <?xml version='1.0' encoding='utf-8'?>
2
+ <Erxl version="1">
3
+ <Loc><Family>BASE</Family><Version>2008</Version><Href>http://www.xbrl.org/2008/generic-label.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>0</Elements> <Namespace>http://xbrl.org/2008/label</Namespace><Prefix>label</Prefix></Loc>
4
+ <Loc><Family>BASE</Family><Version>2008</Version><Href>http://www.xbrl.org/2008/generic-link.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>0</Elements> <Namespace>http://xbrl.org/2008/generic</Namespace><Prefix>gen</Prefix></Loc>
5
+ <Loc><Family>BASE</Family><Version>2010</Version><Href>http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>0</Elements> <Namespace>http://www.xbrl.org/2003/instance</Namespace><Prefix>xbrli</Prefix></Loc>
6
+ <Loc><Family>BASE</Family><Version>2010</Version><Href>http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>0</Elements> <Namespace>http://www.xbrl.org/2003/linkbase</Namespace><Prefix>link</Prefix></Loc>
7
+ <Loc><Family>BASE</Family><Version>2010</Version><Href>http://www.xbrl.org/2003/xl-2003-12-31.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>0</Elements> <Namespace>http://www.xbrl.org/2003/XLink</Namespace><Prefix>xl</Prefix></Loc>
8
+ <Loc><Family>BASE</Family><Version>2010</Version><Href>http://www.xbrl.org/2003/xlink-2003-12-31.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>0</Elements> <Namespace>http://www.w3.org/1999/xlink</Namespace><Prefix>xlink</Prefix></Loc>
9
+ <Loc><Family>BASE</Family><Version>2010</Version><Href>http://www.xbrl.org/2004/ref-2004-08-10.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>0</Elements> <Namespace>http://www.xbrl.org/2004/ref</Namespace><Prefix>ref</Prefix></Loc>
10
+ <Loc><Family>BASE</Family><Version>2010</Version><Href>http://www.xbrl.org/2005/xbrldt-2005.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>1</Elements> <Namespace>http://xbrl.org/2005/xbrldt</Namespace><Prefix>xbrldt</Prefix></Loc>
11
+ <Loc><Family>BASE</Family><Version>2010</Version><Href>http://www.xbrl.org/2006/ref-2006-02-27.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>0</Elements> <Namespace>http://www.xbrl.org/2006/ref</Namespace><Prefix>ref</Prefix></Loc>
12
+ <Loc><Family>BASE</Family><Version>2010</Version><Href>http://www.xbrl.org/2006/xbrldi-2006.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>1</Elements> <Namespace>http://xbrl.org/2006/xbrldi</Namespace><Prefix>xbrldi</Prefix></Loc>
13
+ <Loc><Family>BASE</Family><Version>2010</Version><Href>http://www.xbrl.org/dtr/type/nonNumeric-2009-12-16.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>0</Elements> <Namespace>http://www.xbrl.org/dtr/type/non-numeric</Namespace><Prefix>nonnum</Prefix></Loc>
14
+ <Loc><Family>BASE</Family><Version>2010</Version><Href>http://www.xbrl.org/dtr/type/numeric-2009-12-16.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>0</Elements> <Namespace>http://www.xbrl.org/dtr/type/numeric</Namespace><Prefix>num</Prefix></Loc>
15
+ <Loc><Family>BASE</Family><Version>2010</Version><Href>http://www.xbrl.org/lrr/arcrole/deprecated-2009-12-16.xsd</Href><AttType>SCH</AttType><FileTypeName>Roles/Arcroles</FileTypeName><Elements>0</Elements> <Namespace>http://www.xbrl.org/2009/arcrole/deprecated</Namespace></Loc>
16
+ <Loc><Family>BASE</Family><Version>2010</Version><Href>http://www.xbrl.org/lrr/arcrole/factExplanatory-2009-12-16.xsd</Href><AttType>SCH</AttType><FileTypeName>Roles/Arcroles</FileTypeName><Elements>0</Elements> <Namespace>http://www.xbrl.org/2009/arcrole/fact-explanatoryFact</Namespace></Loc>
17
+ <Loc><Family>BASE</Family><Version>2010</Version><Href>http://www.xbrl.org/lrr/role/deprecated-2009-12-16.xsd</Href><AttType>SCH</AttType><FileTypeName>Roles/Arcroles</FileTypeName><Elements>0</Elements> <Namespace>http://www.xbrl.org/2009/role/deprecated</Namespace></Loc>
18
+ <Loc><Family>BASE</Family><Version>2010</Version><Href>http://www.xbrl.org/lrr/role/negated-2009-12-16.xsd</Href><AttType>SCH</AttType><FileTypeName>Roles/Arcroles</FileTypeName><Elements>0</Elements> <Namespace>http://www.xbrl.org/2009/role/negated</Namespace></Loc>
19
+ <Loc><Family>BASE</Family><Version>2010</Version><Href>http://www.xbrl.org/lrr/role/net-2009-12-16.xsd</Href><AttType>SCH</AttType><FileTypeName>Roles/Arcroles</FileTypeName><Elements>0</Elements> <Namespace>http://www.xbrl.org/2009/role/net</Namespace></Loc>
20
+ <Loc><Family>BASE</Family><Version>2014</Version><Href>http://www.xbrl.org/2014/extensible-enumerations.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>0</Elements> <Namespace>http://xbrl.org/2014/extensible-enumerations</Namespace><Prefix>enum</Prefix></Loc>
21
+ <Loc><Family>BASE</Family><Version>2020</Version><Href>http://www.xbrl.org/dtr/type/2020-01-21/types.xsd</Href><AttType>SCH</AttType><FileTypeName>Roles/Arcroles</FileTypeName><Elements>0</Elements> <Namespace>http://www.xbrl.org/dtr/type/2020-01-21</Namespace></Loc>
22
+ <Loc><Family>BASE</Family><Version>2022</Version><Href>http://www.xbrl.org/dtr/type/2022-03-31/types.xsd</Href><AttType>SCH</AttType><FileTypeName>Roles/Arcroles</FileTypeName><Elements>0</Elements> <Namespace>http://www.xbrl.org/dtr/type/2022-03-31</Namespace></Loc>
23
+ <Loc><Family>BASE</Family><Version>2023</Version><Href>http://www.xbrl.org/2023/calculation-1.1.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>0</Elements> <Namespace>https://xbrl.org/2023/calculation-1.1</Namespace></Loc>
24
+ <Loc><Family>BASE</Family><Version>2024</Version><Href>http://www.xbrl.org/dtr/type/2024-01-31/types.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>0</Elements> <Namespace>http://www.xbrl.org/dtr/type/2024-01-31</Namespace></Loc>
25
+ <Loc><Family>FSA</Family><Version>2013</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/common/2013-08-31/identificationAndOrdering_2013-08-31.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>1</Elements> <Namespace>http://disclosure.edinet-fsa.go.jp/taxonomy/common/2013-08-31/iod</Namespace><Prefix>common</Prefix></Loc>
26
+ <Loc><Family>FSA</Family><Version>2013</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpdei/2013-08-31/jpdei_cor_2013-08-31.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>1</Elements> <Namespace>http://disclosure.edinet-fsa.go.jp/taxonomy/jpdei/2013-08-31/jpdei_cor</Namespace><Prefix>jpdei</Prefix></Loc>
27
+ <Loc><Family>FSA</Family><Version>2013</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpdei/2013-08-31/jpdei_rt_2013-08-31.xsd</Href><AttType>SCH</AttType><FileTypeName>Entry Point</FileTypeName><Elements>0</Elements> <Namespace>http://disclosure.edinet-fsa.go.jp/taxonomy/jpdei/2013-08-31/jpdei_rt</Namespace><Prefix>jpdei</Prefix></Loc>
28
+ <Loc><Family>FSA</Family><Version>2013</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpdei/2013-08-31/label/jpdei_2013-08-31_gla.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
29
+ <Loc><Family>FSA</Family><Version>2013</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpdei/2013-08-31/label/jpdei_2024-11-01_lab-en.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
30
+ <Loc><Family>FSA</Family><Version>2013</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpdei/2013-08-31/label/jpdei_2024-11-01_lab.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
31
+ <Loc><Family>FSA</Family><Version>2013</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpdei/2013-08-31/r/jpdei_000100-000_2013-08-31_def.xml</Href><AttType>DEF</AttType><FileTypeName>Definition, Dimensions</FileTypeName><Elements>0</Elements></Loc>
32
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpcrp-esr/2024-11-01/jpcrp-esr_cor_2024-11-01.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>1</Elements> <Namespace>http://disclosure.edinet-fsa.go.jp/taxonomy/jpcrp-esr/2024-11-01/jpcrp-esr_cor</Namespace><Prefix>jpcrp-esr</Prefix></Loc>
33
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpcrp-esr/2024-11-01/jpcrp-esr_rt_2024-11-01.xsd</Href><AttType>SCH</AttType><FileTypeName>Entry Point</FileTypeName><Elements>0</Elements> <Namespace>http://disclosure.edinet-fsa.go.jp/taxonomy/jpcrp-esr/2024-11-01/jpcrp-esr_rt</Namespace><Prefix>jpcrp-esr</Prefix></Loc>
34
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpcrp-esr/2024-11-01/label/jpcrp-esr_2024-11-01_gla.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
35
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpcrp-esr/2024-11-01/label/jpcrp-esr_2024-11-01_lab-en.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
36
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpcrp-esr/2024-11-01/label/jpcrp-esr_2024-11-01_lab.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
37
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpcrp/2024-11-01/jpcrp_cor_2024-11-01.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>1</Elements> <Namespace>http://disclosure.edinet-fsa.go.jp/taxonomy/jpcrp/2024-11-01/jpcrp_cor</Namespace><Prefix>jpcrp</Prefix></Loc>
38
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpcrp/2024-11-01/jpcrp_rt_2024-11-01.xsd</Href><AttType>SCH</AttType><FileTypeName>Entry Point</FileTypeName><Elements>0</Elements> <Namespace>http://disclosure.edinet-fsa.go.jp/taxonomy/jpcrp/2024-11-01/jpcrp_rt</Namespace><Prefix>jpcrp</Prefix></Loc>
39
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpcrp/2024-11-01/label/jpcrp_2024-11-01_gla.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
40
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpcrp/2024-11-01/label/jpcrp_2024-11-01_lab-en.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
41
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpcrp/2024-11-01/label/jpcrp_2024-11-01_lab.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
42
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpigp/2024-11-01/jpigp_cor_2024-11-01.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>1</Elements> <Namespace>http://disclosure.edinet-fsa.go.jp/taxonomy/jpigp/2024-11-01/jpigp_cor</Namespace><Prefix>jpigp</Prefix></Loc>
43
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpigp/2024-11-01/jpigp_rt_2024-11-01.xsd</Href><AttType>SCH</AttType><FileTypeName>Entry Point</FileTypeName><Elements>0</Elements> <Namespace>http://disclosure.edinet-fsa.go.jp/taxonomy/jpigp/2024-11-01/jpigp_rt</Namespace><Prefix>jpigp</Prefix></Loc>
44
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpigp/2024-11-01/label/jpigp_2024-11-01_gla.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
45
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpigp/2024-11-01/label/jpigp_2024-11-01_lab-en.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
46
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpigp/2024-11-01/label/jpigp_2024-11-01_lab.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
47
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jppfs/2024-11-01/jppfs_cor_2024-11-01.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>1</Elements> <Namespace>http://disclosure.edinet-fsa.go.jp/taxonomy/jppfs/2024-11-01/jppfs_cor</Namespace><Prefix>jppfs</Prefix></Loc>
48
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jppfs/2024-11-01/jppfs_pe_2012.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>1</Elements> <Namespace>http://disclosure.edinet-fsa.go.jp/taxonomy/jppfs/2012/jppfs_pe</Namespace><Prefix>jppfs</Prefix></Loc>
49
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jppfs/2024-11-01/jppfs_rt_2024-11-01.xsd</Href><AttType>SCH</AttType><FileTypeName>Entry Point</FileTypeName><Elements>0</Elements> <Namespace>http://disclosure.edinet-fsa.go.jp/taxonomy/jppfs/2024-11-01/jppfs_rt</Namespace><Prefix>jppfs</Prefix></Loc>
50
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jppfs/2024-11-01/label/jppfs_2024-11-01_gla.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
51
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jppfs/2024-11-01/label/jppfs_2024-11-01_lab-en.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
52
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jppfs/2024-11-01/label/jppfs_2024-11-01_lab.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
53
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpsps/2024-11-01/jpsps_cor_2024-11-01.xsd</Href><AttType>SCH</AttType><FileTypeName>Schema</FileTypeName><Elements>1</Elements> <Namespace>http://disclosure.edinet-fsa.go.jp/taxonomy/jpsps/2024-11-01/jpsps_cor</Namespace><Prefix>jppfs</Prefix></Loc>
54
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpsps/2024-11-01/jpsps_rt_2024-11-01.xsd</Href><AttType>SCH</AttType><FileTypeName>Entry Point</FileTypeName><Elements>0</Elements> <Namespace>http://disclosure.edinet-fsa.go.jp/taxonomy/jpsps/2024-11-01/jpsps_rt</Namespace><Prefix>jpsps</Prefix></Loc>
55
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpsps/2024-11-01/label/jpsps_2024-11-01_gla.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
56
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpsps/2024-11-01/label/jpsps_2024-11-01_lab-en.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
57
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpsps/2024-11-01/label/jpsps_2024-11-01_lab.xml</Href><AttType>LAB</AttType><FileTypeName>Labels</FileTypeName><Elements>0</Elements></Loc>
58
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpsps/2024-11-01/r/jpsps-dei_000100-000_2024-11-01_def.xml</Href><AttType>DEF</AttType><FileTypeName>Definition, Dimensions</FileTypeName><Elements>0</Elements></Loc>
59
+ <Loc><Family>FSA</Family><Version>2024</Version><Href>http://disclosure.edinet-fsa.go.jp/taxonomy/jpsps/2024-11-01/r/jpsps-dei_000200-000_2024-11-01_def.xml</Href><AttType>DEF</AttType><FileTypeName>Definition, Dimensions</FileTypeName><Elements>0</Elements></Loc>
60
+ </Erxl>
@@ -0,0 +1,61 @@
1
+ """
2
+ See COPYRIGHT.md for copyright information.
3
+ """
4
+ from __future__ import annotations
5
+
6
+ from collections.abc import Iterable
7
+ from typing import Any
8
+
9
+ from arelle import XbrlConst
10
+ from arelle.ValidateXbrl import ValidateXbrl
11
+ from arelle.typing import TypeGetText
12
+ from arelle.utils.PluginHooks import ValidationHook
13
+ from arelle.utils.validate.Decorator import validation
14
+ from arelle.utils.validate.Validation import Validation
15
+ from ..DisclosureSystems import (DISCLOSURE_SYSTEM_EDINET)
16
+ from ..PluginValidationDataExtension import PluginValidationDataExtension
17
+
18
+ _: TypeGetText
19
+
20
+
21
+ @validation(
22
+ hook=ValidationHook.XBRL_FINALLY,
23
+ disclosureSystems=[DISCLOSURE_SYSTEM_EDINET],
24
+ )
25
+ def rule_EC5002E(
26
+ pluginData: PluginValidationDataExtension,
27
+ val: ValidateXbrl,
28
+ *args: Any,
29
+ **kwargs: Any,
30
+ ) -> Iterable[Validation]:
31
+ """
32
+ EDINET.EC5002E: A unit other than number of shares (xbrli:shares) has been set for the
33
+ Number of Shares (xbrli:sharesItemType) item '{xxx}yyy'.
34
+ Please check the units and enter the correct information.
35
+
36
+ Similar to "xbrl.4.8.2:sharesFactUnit-notSharesMeasure" and "xbrl.4.8.2:sharesFactUnit-notSingleMeasure"
37
+ TODO: Consolidate this rule with the above two rules if possible.
38
+ """
39
+ errorFacts = []
40
+ for fact in val.modelXbrl.facts:
41
+ concept = fact.concept
42
+ if not concept.isShares:
43
+ continue
44
+ unit = fact.unit
45
+ measures = unit.measures
46
+ if (
47
+ not measures or
48
+ len(measures[0]) != 1 or
49
+ len(measures[1]) != 0 or
50
+ measures[0][0] != XbrlConst.qnXbrliShares
51
+ ):
52
+ errorFacts.append(fact)
53
+ for fact in errorFacts:
54
+ yield Validation.error(
55
+ codes='EDINET.EC5002E',
56
+ msg=_("A unit other than number of shares (xbrli:shares) has been set for "
57
+ "the Number of Shares (xbrli:sharesItemType) item '%(qname)s'. "
58
+ "Please check the units and enter the correct information."),
59
+ qname=fact.qname.clarkNotation,
60
+ modelObject=fact,
61
+ )
@@ -0,0 +1,48 @@
1
+ """
2
+ See COPYRIGHT.md for copyright information.
3
+ """
4
+ from __future__ import annotations
5
+
6
+ from collections.abc import Iterable
7
+ from typing import Any
8
+
9
+ from arelle import XbrlConst
10
+ from arelle.ValidateXbrl import ValidateXbrl
11
+ from arelle.typing import TypeGetText
12
+ from arelle.utils.PluginHooks import ValidationHook
13
+ from arelle.utils.validate.Decorator import validation
14
+ from arelle.utils.validate.Validation import Validation
15
+ from ..DisclosureSystems import (DISCLOSURE_SYSTEM_EDINET)
16
+ from ..PluginValidationDataExtension import PluginValidationDataExtension
17
+
18
+ _: TypeGetText
19
+
20
+
21
+ @validation(
22
+ hook=ValidationHook.XBRL_FINALLY,
23
+ disclosureSystems=[DISCLOSURE_SYSTEM_EDINET],
24
+ )
25
+ def rule_frta_2_1_9(
26
+ pluginData: PluginValidationDataExtension,
27
+ val: ValidateXbrl,
28
+ *args: Any,
29
+ **kwargs: Any,
30
+ ) -> Iterable[Validation]:
31
+ """
32
+ EDINET.EC5710W: [FRTA.2.1.9] All documentation of a concept must be contained
33
+ in XBRL linkbases. Do not use the xsd:documentation element in an element definition.
34
+ """
35
+ errors = []
36
+ for modelDocument in val.modelXbrl.urlDocs.values():
37
+ if pluginData.isStandardTaxonomyUrl(modelDocument.uri, val.modelXbrl):
38
+ continue
39
+ rootElt = modelDocument.xmlRootElement
40
+ for elt in rootElt.iterdescendants(XbrlConst.qnXsdDocumentation.clarkNotation):
41
+ errors.append(elt)
42
+ if len(errors) > 0:
43
+ yield Validation.error(
44
+ codes='EDINET.EC5710W.FRTA.2.1.9',
45
+ msg=_("All documentation of a concept must be contained in XBRL linkbases. "
46
+ "Taxonomy element declarations should not use the XML Schema documentation element."),
47
+ modelObject=errors,
48
+ )
@@ -0,0 +1,76 @@
1
+ """
2
+ See COPYRIGHT.md for copyright information.
3
+ """
4
+ from __future__ import annotations
5
+
6
+ from collections.abc import Iterable
7
+ from typing import Any
8
+
9
+ from arelle import XbrlConst, XmlUtil
10
+ from arelle.UrlUtil import isHttpUrl, splitDecodeFragment
11
+ from arelle.ValidateXbrl import ValidateXbrl
12
+ from arelle.typing import TypeGetText
13
+ from arelle.utils.PluginHooks import ValidationHook
14
+ from arelle.utils.validate.Decorator import validation
15
+ from arelle.utils.validate.Validation import Validation
16
+ from ..DisclosureSystems import (DISCLOSURE_SYSTEM_EDINET)
17
+ from ..PluginValidationDataExtension import PluginValidationDataExtension
18
+
19
+ _: TypeGetText
20
+
21
+
22
+ @validation(
23
+ hook=ValidationHook.XBRL_FINALLY,
24
+ disclosureSystems=[DISCLOSURE_SYSTEM_EDINET],
25
+ )
26
+ def rule_gfm_1_1_3(
27
+ pluginData: PluginValidationDataExtension,
28
+ val: ValidateXbrl,
29
+ *args: Any,
30
+ **kwargs: Any,
31
+ ) -> Iterable[Validation]:
32
+ """
33
+ EDINET.EC5700W: [GFM 1.1.3] The URI content of the xlink:href attribute,
34
+ the xsi:schemaLocation attribute and the schemaLocation attribute must
35
+ be relative and contain no forward slashes, or a recognized external
36
+ location of a standard taxonomy schema file, or a "#" followed by a
37
+ shorthand xpointer.
38
+ """
39
+ values = []
40
+ for modelDocument in val.modelXbrl.urlDocs.values():
41
+ if pluginData.isStandardTaxonomyUrl(modelDocument.uri, val.modelXbrl):
42
+ continue
43
+ rootElt = modelDocument.xmlRootElement
44
+ for elt in rootElt.iterdescendants(XbrlConst.qnLinkLoc.clarkNotation):
45
+ uri = elt.attrib.get(XbrlConst.qnXlinkHref.clarkNotation)
46
+ values.append((modelDocument, elt, uri))
47
+ for elt in rootElt.iterdescendants(XbrlConst.qnXsdImport.clarkNotation):
48
+ uri = elt.attrib.get('schemaLocation')
49
+ values.append((modelDocument, elt, uri))
50
+ for elt in rootElt.iterdescendants(XbrlConst.qnLinkLinkbase.clarkNotation):
51
+ uri = elt.attrib.get(XbrlConst.qnXsiSchemaLocation.clarkNotation)
52
+ values.append((modelDocument, elt, uri))
53
+ for modelDocument, elt, uri in values:
54
+ if uri is None:
55
+ continue
56
+ if not isHttpUrl(uri):
57
+ if '/' not in uri:
58
+ continue # Valid relative path
59
+ if pluginData.isStandardTaxonomyUrl(uri, val.modelXbrl):
60
+ continue # Valid external URL
61
+ splitUri, hrefId = splitDecodeFragment(uri)
62
+ if pluginData.isStandardTaxonomyUrl(splitUri, val.modelXbrl):
63
+ if hrefId is None or len(hrefId) == 0:
64
+ continue # Valid external URL
65
+ if not any(scheme == "element" for scheme, __ in XmlUtil.xpointerSchemes(hrefId)):
66
+ continue # Valid shorthand xpointer
67
+ yield Validation.error(
68
+ codes='EDINET.EC5700W.GFM.1.1.3',
69
+ msg=_("The URI content of the xlink:href attribute, the xsi:schemaLocation "
70
+ "attribute and the schemaLocation attribute must be relative and "
71
+ "contain no forward slashes, or a recognized external location of "
72
+ "a standard taxonomy schema file, or a '#' followed by a shorthand "
73
+ "xpointer. The URI '%(uri)s' is not valid."),
74
+ uri=uri,
75
+ modelObject=elt,
76
+ )
@@ -4,11 +4,10 @@ See COPYRIGHT.md for copyright information.
4
4
  from __future__ import annotations
5
5
 
6
6
  import re
7
- import zipfile
8
7
  from collections import defaultdict
9
8
  from collections.abc import Iterable
10
9
  from pathlib import Path
11
- from typing import Any, cast, IO
10
+ from typing import Any
12
11
 
13
12
  from arelle.ValidateXbrl import ValidateXbrl
14
13
  from arelle.typing import TypeGetText
@@ -17,6 +16,7 @@ from arelle.utils.validate.Decorator import validation
17
16
  from arelle.utils.validate.Validation import Validation
18
17
  from ..DisclosureSystems import (DISCLOSURE_SYSTEM_EDINET)
19
18
  from ..FormType import FormType, HTML_EXTENSIONS, IMAGE_EXTENSIONS
19
+ from ..Manifest import parseManifests
20
20
  from ..PluginValidationDataExtension import PluginValidationDataExtension
21
21
 
22
22
  _: TypeGetText
@@ -452,3 +452,73 @@ def rule_EC1020E(
452
452
  path=str(path),
453
453
  file=str(path),
454
454
  )
455
+
456
+
457
+ @validation(
458
+ hook=ValidationHook.XBRL_FINALLY,
459
+ disclosureSystems=[DISCLOSURE_SYSTEM_EDINET],
460
+ )
461
+ def rule_manifest_preferredFilename(
462
+ pluginData: PluginValidationDataExtension,
463
+ val: ValidateXbrl,
464
+ *args: Any,
465
+ **kwargs: Any,
466
+ ) -> Iterable[Validation]:
467
+ """
468
+ EDINET.EC5804E: The preferredFilename attribute must be set on the instance
469
+ element in the manifest file.
470
+
471
+ EDINET.EC5805E: The instance file extension is not ".xbrl". File name: xxx
472
+ Please change the extension of the instance name set in the preferredFilename
473
+ attribute value of the instance element in the manifest file to ".xbrl".
474
+
475
+ EDINET.EC5806E: The same instance file name is set multiple times. File name: xxx
476
+ The preferredFilename attribute value of the instance element in the manifest
477
+ file must be unique within the same file.
478
+ """
479
+ if not pluginData.shouldValidateUpload(val):
480
+ return
481
+ manifests = parseManifests(val.modelXbrl.fileSource)
482
+ for manifest in manifests:
483
+ preferredFilenames = set()
484
+ duplicateFilenames = set()
485
+ for instance in manifest.instances:
486
+ if len(instance.preferredFilename) == 0:
487
+ yield Validation.error(
488
+ codes='EDINET.EC5804E',
489
+ msg=_("The instance file name is not set. "
490
+ "Set the instance name as the preferredFilename attribute value "
491
+ "of the instance element in the manifest file. (manifest: '%(manifest)s', id: %(id)s)"),
492
+ manifest=str(manifest.path),
493
+ id=instance.id,
494
+ )
495
+ continue
496
+ preferredFilename = Path(instance.preferredFilename)
497
+ if preferredFilename.suffix != '.xbrl':
498
+ yield Validation.error(
499
+ codes='EDINET.EC5805E',
500
+ msg=_("The instance file extension is not '.xbrl'. "
501
+ "File name: '%(preferredFilename)s'. "
502
+ "Please change the extension of the instance name set in the "
503
+ "preferredFilename attribute value of the instance element in "
504
+ "the manifest file to '.xbrl'. (manifest: '%(manifest)s', id: %(id)s)"),
505
+ preferredFilename=instance.preferredFilename,
506
+ manifest=str(manifest.path),
507
+ id=instance.id,
508
+ )
509
+ continue
510
+ if instance.preferredFilename in preferredFilenames:
511
+ duplicateFilenames.add(instance.preferredFilename)
512
+ continue
513
+ preferredFilenames.add(instance.preferredFilename)
514
+ for duplicateFilename in duplicateFilenames:
515
+ yield Validation.error(
516
+ codes='EDINET.EC5806E',
517
+ msg=_("The same instance file name is set multiple times. "
518
+ "File name: '%(preferredFilename)s'. "
519
+ "The preferredFilename attribute value of the instance "
520
+ "element in the manifest file must be unique within the "
521
+ "same file. (manifest: '%(manifest)s')"),
522
+ manifest=str(manifest.path),
523
+ preferredFilename=duplicateFilename,
524
+ )
@@ -1109,6 +1109,21 @@ def validateXbrlFinally(val: ValidateXbrl, *args: Any, **kwargs: Any) -> None:
1109
1109
  _("Extension elements must not duplicate the existing elements from the core taxonomy and be identifiable %(qname)s."),
1110
1110
  modelObject=(c,_i), qname=c.qname)
1111
1111
 
1112
+ extensionTaxonomyDirectoryPrefix = val.authParam["reportPackageExtensionTaxonomyDirectoryPrefix"]
1113
+ if extensionTaxonomyDirectoryPrefix is not None and val.modelXbrl.fileSource.dir is not None:
1114
+ for filepath in val.modelXbrl.fileSource.dir:
1115
+ filepath_parts = filepath.split('/')
1116
+ if filepath_parts[1] in ['META-INF', 'reports']:
1117
+ continue
1118
+ if not filepath_parts[1].startswith(extensionTaxonomyDirectoryPrefix):
1119
+ modelXbrl.error(
1120
+ 'arelle.ESEF.reportPackageExtensionTaxonomyDirectoryPrefix',
1121
+ _('The XBRL linkbase files must live within the report package under a directory that starts '
1122
+ 'with `{}`').format(extensionTaxonomyDirectoryPrefix),
1123
+ modelObject=val.modelXbrl
1124
+ )
1125
+ break
1126
+
1112
1127
  modelXbrl.profileActivity(_statusMsg, minTimeToShow=0.0)
1113
1128
  modelXbrl.modelManager.showStatus(None)
1114
1129
 
@@ -42,6 +42,7 @@
42
42
  ],
43
43
  "comment": "default parameters where not specified by authority",
44
44
  "reportPackageMaxMB": null,
45
+ "reportPackageExtensionTaxonomyDirectoryPrefix": null,
45
46
  "identiferScheme": "http://standards.iso.org/iso/17442",
46
47
  "ixTargetUsage": "warning",
47
48
  "extensionAbstractContexts": "warning",
@@ -171,6 +172,7 @@
171
172
  },
172
173
  "DBA": {
173
174
  "name": "Danish Business Authority",
175
+ "reportPackageExtensionTaxonomyDirectoryPrefix": "xbrl.",
174
176
  "reportPackageMaxMB": "2000",
175
177
  "reportPackageMeasurement": "unzipped",
176
178
  "ixTargetUsage": "allowed",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arelle-release
3
- Version: 2.37.33
3
+ Version: 2.37.35
4
4
  Summary: An open source XBRL platform.
5
5
  Author-email: "arelle.org" <support@arelle.org>
6
6
  License-Expression: Apache-2.0
@@ -20,7 +20,7 @@ arelle/DialogPluginManager.py,sha256=cr7GWNuYttg7H0pM5vaCPuxgDVgtZzR6ZamX957_1w8
20
20
  arelle/DialogRssWatch.py,sha256=mjc4pqyFDISY4tQtME0uSRQ3NlcWnNsOsMu9Zj8tTd0,13789
21
21
  arelle/DialogURL.py,sha256=JH88OPFf588E8RW90uMaieok7A_4kOAURQ8kHWVhnao,4354
22
22
  arelle/DialogUserPassword.py,sha256=kWPlCCihhwvsykDjanME9qBDtv6cxZlsrJyoMqiRep4,13769
23
- arelle/DisclosureSystem.py,sha256=g3XXMjuyKJk2eoqvHGqoyIs2bMfcODwOeISDRCcY9gc,24749
23
+ arelle/DisclosureSystem.py,sha256=mQlz8eezPpJuG6gHBV-x4-5Hne3LVh8TQf-Qm9jiFxI,24757
24
24
  arelle/FileSource.py,sha256=S19Rll9CoRPZ2zJCAlNHv1jt2UUfiLbSgI2tDdJq5Xc,47899
25
25
  arelle/FunctionCustom.py,sha256=d1FsBG14eykvpLpgaXpN8IdxnlG54dfGcsXPYfdpA9Q,5880
26
26
  arelle/FunctionFn.py,sha256=BcZKah1rpfquSVPwjvknM1pgFXOnK4Hr1e_ArG_mcJY,38058
@@ -46,7 +46,7 @@ arelle/ModelRenderingObject.py,sha256=iPhSUlSBG-FLzAfIdUW06UZDgTCaZJ4K2mxvAtSe2B
46
46
  arelle/ModelRssItem.py,sha256=GzFkmluOlFsVcrxn9HAyOAcuE7rcHUOGkp4Q6F2IlT8,7713
47
47
  arelle/ModelRssObject.py,sha256=xjuwyJ8pU5sQmNPJFQakDEEnujZg2bMCTaj3zVezHL8,992
48
48
  arelle/ModelTestcaseObject.py,sha256=dnCxatJcFPlu5BgTuToqgrQowYNx4YtA5KrmW4vHko4,22432
49
- arelle/ModelValue.py,sha256=t0mVl3-EcE4MaXdRL9F94XaBwBfu1xG2DmFuHOczrEk,39447
49
+ arelle/ModelValue.py,sha256=0sr7njFjGI2W3Bct2dxf2LoG_fLerHQouQtM0v0ZY2E,39573
50
50
  arelle/ModelVersObject.py,sha256=cPD1IzhkCfuV1eMgVFWes88DH_6WkUj5kj7sgGF2M0I,26062
51
51
  arelle/ModelVersReport.py,sha256=bXEA9K3qkH57aABn5l-m3CTY0FAcF1yX6O4fo-URjl8,73326
52
52
  arelle/ModelXbrl.py,sha256=bj-_enkb2AV2KVCRrRf2YPGxOoO9cdqKnVqfy3bGFZk,72125
@@ -114,7 +114,7 @@ arelle/ViewWinVersReport.py,sha256=aYfsOgynVZpMzl6f2EzQCBLzdihYGycwb5SiTghkgMQ,9
114
114
  arelle/ViewWinXml.py,sha256=4ZGKtjaoCwU9etKYm9ZAS7jSmUxba1rqNEdv0OIyjTY,1250
115
115
  arelle/WatchRss.py,sha256=5Ih4igH2MM4hpOuAXy9eO0QAyZ7jZR3S5bPzo2sdFpw,14097
116
116
  arelle/WebCache.py,sha256=HlF4vfjxO0bSFHqMPfjnmkrzc7RK9XT714a7g3XFTDY,45192
117
- arelle/XbrlConst.py,sha256=gKYJECjuOEn0z0RRAaHpVCqh2NnBMfPLGxoLohYGGH4,57657
117
+ arelle/XbrlConst.py,sha256=k-cingAiunkqPd7YkFMgF6y5syj9GRWP84DTK2aDrCY,57935
118
118
  arelle/XbrlUtil.py,sha256=s2Vmrh-sZI5TeuqsziKignOc3ao-uUgnCNoelP4dDj0,9212
119
119
  arelle/XhtmlValidate.py,sha256=0gtm7N-kXK0RB5o3c1AQXjfFuRp1w2fKZZAeyruNANw,5727
120
120
  arelle/XmlUtil.py,sha256=1VToOOylF8kbEorEdZLThmq35j9bmuF_DS2q9NthnHU,58774
@@ -123,7 +123,7 @@ arelle/XmlValidateConst.py,sha256=U_wN0Q-nWKwf6dKJtcu_83FXPn9c6P8JjzGA5b0w7P0,33
123
123
  arelle/XmlValidateParticles.py,sha256=Mn6vhFl0ZKC_vag1mBwn1rH_x2jmlusJYqOOuxFPO2k,9231
124
124
  arelle/XmlValidateSchema.py,sha256=6frtZOc1Yrx_5yYF6V6oHbScnglWrVbWr6xW4EHtLQI,7428
125
125
  arelle/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
126
- arelle/_version.py,sha256=RAjXCgP-9p3VBfxEV85KcfgMP1noD9OimvpQH9hUuu8,515
126
+ arelle/_version.py,sha256=xskzS16quHADstT6foQZG7ObyYWctCHF2zPFpKL4EAM,515
127
127
  arelle/typing.py,sha256=PRe-Fxwr2SBqYYUVPCJ3E7ddDX0_oOISNdT5Q97EbRM,1246
128
128
  arelle/api/Session.py,sha256=27HVuK3Bz1_21l4_RLn1IQg6v0MNsUEYrHajymyWwxI,7429
129
129
  arelle/archive/CustomLogger.py,sha256=v_JXOCQLDZcfaFWzxC9FRcEf9tQi4rCI4Sx7jCuAVQI,1231
@@ -392,14 +392,20 @@ arelle/plugin/validate/DBA/rules/tm.py,sha256=ui9oKBqlAForwkQ9kk9KBiUogTJE5pv1Rb
392
392
  arelle/plugin/validate/DBA/rules/tr.py,sha256=zdi3kQ82whmweVWRLbMvcNpM8sqtUliPsGfd81rgZws,14671
393
393
  arelle/plugin/validate/EBA/__init__.py,sha256=1kW-04W32sStSAL8wvW1ZpXnjlFv6KLbfE4aifYUB2A,46000
394
394
  arelle/plugin/validate/EBA/config.xml,sha256=37wMVUAObK-XEqakqD8zPNog20emYt4a_yfL1AKubF8,2022
395
+ arelle/plugin/validate/EDINET/Constants.py,sha256=QG69rWdpIrpQzZQkRcDWk2i3rlBVohr4VtSdW-IS5_w,734
395
396
  arelle/plugin/validate/EDINET/DisclosureSystems.py,sha256=3rKG42Eg-17Xx_KXU_V5yHW6I3LTwQunvf4a44C9k_4,36
396
397
  arelle/plugin/validate/EDINET/FormType.py,sha256=pJfKjdjqFcRLFgH6xbEixvpwatZBBHI8uI3xjjhaPI0,3175
397
- arelle/plugin/validate/EDINET/PluginValidationDataExtension.py,sha256=jW4BcDJnedzy-D2rOPq8p_rIAmJIEcgC0tiStjbygAA,4894
398
+ arelle/plugin/validate/EDINET/Manifest.py,sha256=VWenzA1ndOp802zpTELSLREbCrzrA-nM1UCRpRf1Q3M,4849
399
+ arelle/plugin/validate/EDINET/PluginValidationDataExtension.py,sha256=VSSffANEC5kuvLC54pWYQ7w8fuSKo5LGdiuZ3NwWktg,5061
398
400
  arelle/plugin/validate/EDINET/ValidationPluginExtension.py,sha256=HIGOpBOyuVs5SEh573M3IzdouRdEuNIBkdumieZi8r0,959
399
- arelle/plugin/validate/EDINET/__init__.py,sha256=1kJUaV2AbNZdakKSa_v3opdyCRKO3gva62RpHVOrpIE,4398
400
- arelle/plugin/validate/EDINET/resources/config.xml,sha256=7uxn_HZT3USgbs2GQkew-dCUzlEgUGs62PiqEfljPgk,514
401
+ arelle/plugin/validate/EDINET/__init__.py,sha256=ew9Rc2qJe5d3XvOOFzhX6MfzxNUtxIYfxRGX-wkfR1c,3555
402
+ arelle/plugin/validate/EDINET/resources/config.xml,sha256=GmLcW7UIj5koXJkN19P6Nq5EZJcs6gKQLQ5f2V6u78w,614
403
+ arelle/plugin/validate/EDINET/resources/edinet-taxonomies.xml,sha256=997I3RGTLg5OY3vn5hQxVFAAxOmDSOYpuyQe6VnWSY0,16285
401
404
  arelle/plugin/validate/EDINET/rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
402
- arelle/plugin/validate/EDINET/rules/upload.py,sha256=sZFDSRWukJZEEBfg_RsG1q3Qw1IHhD0LZjl9LL1i9Ao,17048
405
+ arelle/plugin/validate/EDINET/rules/edinet.py,sha256=hm5T8PiQbOKP58BiSV9UFvKQX10uNBpxUZ06ORSU1cE,2117
406
+ arelle/plugin/validate/EDINET/rules/frta.py,sha256=l7BQHOenDjYrpCX6bsXyUHgyvkjbfvJWfbpBthCHmBI,1713
407
+ arelle/plugin/validate/EDINET/rules/gfm.py,sha256=rj1ylvRIoauyzlEW1z1UxOkgO6fzvoMl5myRKkEZzY4,3295
408
+ arelle/plugin/validate/EDINET/rules/upload.py,sha256=HZ-9Gk6WtIichTGcSsSGIrMXNgsgJYQYwfUKeLs1XWU,20369
403
409
  arelle/plugin/validate/ESEF/Const.py,sha256=JujF_XV-_TNsxjGbF-8SQS4OOZIcJ8zhCMnr-C1O5Ho,22660
404
410
  arelle/plugin/validate/ESEF/Dimensions.py,sha256=MOJM7vwNPEmV5cu-ZzPrhx3347ZvxgD6643OB2HRnIk,10597
405
411
  arelle/plugin/validate/ESEF/Util.py,sha256=QH3btcGqBpr42M7WSKZLSdNXygZaZLfEiEjlxoG21jE,7950
@@ -409,9 +415,9 @@ arelle/plugin/validate/ESEF/ESEF_2021/Image.py,sha256=4bnhuy5viBU0viPjb4FhcRRjVV
409
415
  arelle/plugin/validate/ESEF/ESEF_2021/ValidateXbrlFinally.py,sha256=Oh_Qy2Shug3wN1-uwct0BCnuNe36RoCQvLEJxdmE1HY,63941
410
416
  arelle/plugin/validate/ESEF/ESEF_2021/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
411
417
  arelle/plugin/validate/ESEF/ESEF_Current/DTS.py,sha256=epp-PBh1NJzQqgxUE6C468HmoDc2w3j54rMwfiOAry4,29334
412
- arelle/plugin/validate/ESEF/ESEF_Current/ValidateXbrlFinally.py,sha256=DL6k5ebGTgIdUDWz9BtN6x9VQFzRin_xje5iMhXx3_8,74330
418
+ arelle/plugin/validate/ESEF/ESEF_Current/ValidateXbrlFinally.py,sha256=XMFlRc9X-dwMkyaEMWxmNWnTRBlFjzpA8JsyMWknzvs,75251
413
419
  arelle/plugin/validate/ESEF/ESEF_Current/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
414
- arelle/plugin/validate/ESEF/resources/authority-validations.json,sha256=JriLZ45KmUYlQiPbXJCAahobqdrst64Ay77bofZhB5Q,14940
420
+ arelle/plugin/validate/ESEF/resources/authority-validations.json,sha256=ou4Hd7P237vSmck0MMLdNvN9J4DzzWawbDmrRnsIj-4,15069
415
421
  arelle/plugin/validate/ESEF/resources/config.xml,sha256=t3STU_-QYM7Ay8YwZRPapnohiWVWhjfr4L2Rjx9xN9U,3902
416
422
  arelle/plugin/validate/FERC/__init__.py,sha256=V4fXcFKBsjFFPs9_1NhvDjWpEQCoQM0tRQMS0I1Ua7U,11462
417
423
  arelle/plugin/validate/FERC/config.xml,sha256=bn9b8eCqJA1J62rYq1Nz85wJrMGAahVmmnIUQZyerjo,1919
@@ -750,9 +756,9 @@ arelle/utils/validate/ValidationUtil.py,sha256=9vmSvShn-EdQy56dfesyV8JjSRVPj7txr
750
756
  arelle/utils/validate/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
751
757
  arelle/webserver/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
752
758
  arelle/webserver/bottle.py,sha256=P-JECd9MCTNcxCnKoDUvGcoi03ezYVOgoWgv2_uH-6M,362
753
- arelle_release-2.37.33.dist-info/licenses/LICENSE.md,sha256=Q0tn6q0VUbr-NM8916513NCIG8MNzo24Ev-sxMUBRZc,3959
754
- arelle_release-2.37.33.dist-info/METADATA,sha256=uXm8EVfOHE2g5IEWyUcC9UDreYR5taOMDuwboUuNANw,9137
755
- arelle_release-2.37.33.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
756
- arelle_release-2.37.33.dist-info/entry_points.txt,sha256=Uj5niwfwVsx3vaQ3fYj8hrZ1xpfCJyTUA09tYKWbzpo,111
757
- arelle_release-2.37.33.dist-info/top_level.txt,sha256=fwU7SYawL4_r-sUMRg7r1nYVGjFMSDvRWx8VGAXEw7w,7
758
- arelle_release-2.37.33.dist-info/RECORD,,
759
+ arelle_release-2.37.35.dist-info/licenses/LICENSE.md,sha256=Q0tn6q0VUbr-NM8916513NCIG8MNzo24Ev-sxMUBRZc,3959
760
+ arelle_release-2.37.35.dist-info/METADATA,sha256=s6_Ry1tzo2Rm-L8keJcCO6y-ChrtoedS5TjekOK7-Ec,9137
761
+ arelle_release-2.37.35.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
762
+ arelle_release-2.37.35.dist-info/entry_points.txt,sha256=Uj5niwfwVsx3vaQ3fYj8hrZ1xpfCJyTUA09tYKWbzpo,111
763
+ arelle_release-2.37.35.dist-info/top_level.txt,sha256=fwU7SYawL4_r-sUMRg7r1nYVGjFMSDvRWx8VGAXEw7w,7
764
+ arelle_release-2.37.35.dist-info/RECORD,,