Issues Accessing Concept Names, Dimensions, and Members in Xule/Arelle with XBRL 3.0 Rule Syntax
Hi everyone,
I am working with the latest Arelle and Xule plugin versions to validate some real-world XBRL instances using the new XBRL Rules Syntax (Rule 3 / XBRL Query and Rules Language 1.0 PWD).
However, I’m running into several issues and inconsistencies:
I can only extract the raw values (fact numbers) from my instance documents; I cannot access concept names, dimensions, or members using the new Rule 3 syntax (e.g., @concept, @dimension, @member, @qname, etc.).
Attempts to use the official syntax described in the specification (https://www.xbrl.org/Specification/xbrl-rules-3.0/PWD-2024-06-11/xbrl-rules-3.0-PWD-2024-06-11.html) result in errors like:
'value' is not a valid property
Concept dimension not found
Concept segment not found
qname not found or similar
Even with namespace declarations, explicit member/aspect access, or syntax from the latest XBRL Rule 3 and XBRL Query and Rules Language 1.0 documentation, the rules only seem to work with numbers—not with concept or dimension identifiers.
Many working Rule 3 examples on xbrl.us or in their PDF guide do not run in my environment (Arelle + Xule) but might work in the online Xule Playground.
When I output all facts with output { @ } or similar, I only see the numeric values without any mapping to their concept or context, making automated validation impossible.
My XBRL instance includes proper namespaces and taxonomy imports. Xule is installed and loaded correctly, and I can see values for all facts, but cannot access their identifiers or dimensions by rule.
Example of attempted rule:
Result/Error:
What am I missing?
Is the latest Rule 3/XBRL QRL syntax simply not implemented in the current Xule/Arelle releases?
Is there a workaround for getting concept, dimension, and member identifiers in Xule rules, or is manual mapping/parsing from the XBRL XML the only option?
Has anyone gotten Rule 3/XBRL QRL syntax to work for concept/dimension/member queries in Arelle/Xule, and if so, can you provide a working example?
Any guidance or clarification is greatly appreciated!
Hi Vahid – There are a couple of free training modules in the related resources section of https://xbrl.us/xule that might be of interest.
The XULE expression {@} simply evaluates all facts in a report. With no other instructions, the output of the rule will be just that – every XBRL fact value from the report. If you include the message function of XULE in the file, it can include attributes of facts returned by the rule.
Please update your output so plural @dimensions replaces singular @dimension as defined in the documentation and use set().sum to add the values returned by the expression (see 11.12.11 in the documentation – Set and list properties and functions). If you add a second expression and message to your XULE file, you can use the message component below the output expression like this:
message
"{$rule-value.concept.local-name} {$rule-value.period} {$rule-value} {$rule-value.unit} {$rule-value.dimensions}"
If those fixes to your expression don’t resolve the issues you’re experiencing, Here's are two very simple XULE expressions you can run in a Jupyter notebook from a web browser that might help with your work: https://colab.research.google.com/github/xbrlus/xule/blob/jupyter/sample-colab.ipynb
Except for the very first line in the second cell of the notebook, replace what’s in the XULE file in step 1 with what’s below so you can see two expressions run that
If you define things like units and/or period as part of the expression, you can filter these results further.
/** add constants and namespaces below **/
namespace us-gaap = http://fasb.org/us-gaap/2022
namespace sj = http://www.scienjoyholdingcorp.com/20211231
constant $myconcept = us-gaap:FiniteLivedIntangibleAssetsGross
constant $mymember = sj:SoftwareMember
constant $mymember = us-gaap:TrademarksMember
/** modify rule below **/
output example
/** filtering a dimension by a concept - this will include dimension defaults, **/
/** otherwise use the same expression as sumsaligned **/
/** to get specific member values, add '=$mymember' or '=$mymember2' after Axis (no quotes) **/
{@us-gaap:FiniteLivedIntangibleAssetsByMajorClassAxis @concept= $myconcept}
message
"{$rule-value.concept.local-name} {$rule-value.period} {$rule-value} {$rule-value.unit} {$rule-value.dimensions}"
output sumsaligned
/** filter the concept by dimensions with a wildcard to not include the default **/
{set(@concept=$myconcept @dimensions=*).sum}
message
"The sum of the dimensions for {$myconcept} is {$rule-value}."
I hope this helps.
Sincerely,
David
--
---
You received this message because you are subscribed to a topic in the Google Groups "Arelle-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/arelle-users/5GIW9bqYdlU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to arelle-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/arelle-users/2453ed83-0987-4455-98e6-49b64b6c364fn%40googlegroups.com.