Re: advice on modeling an XBRL fact as a triple

Hi Bob,

Since my last email, I have managed to get my XBRL to RDF converter 
to translate linkbases, using target namespace and element names for 
concepts in place of relative URIs the point to the declaration of 
the concept in the XBRL XML schema files. For XLink, the latter is 
satisfactory, but for RDF, I think we should use URIs for concepts 
that are independent on which machine the XBRL happens to be on.

The translation to RDF directly models the XBRL semantics, including 
the representation of taxonomy overrides. This will pose a 
significant challenge for reasoning over the RDF data set.

Further work is needed to extract more semantics from the schemas, 
which should open the way to experiments on validation. The draft
rendering linkbase is interesting in that it defines relationships 
between rendering resources and will require special treatment.

I am now looking forward to some experiments with the Sesame RDF 
data store, e.g. work on creating web-based tools to browse the 
taxonomy and to generate various kinds of views on to the data.

There is also an opportunity to explore the use of Owl to relate 
different XBRL taxonomies, which could be valuable for comparing 
company reports from different parts of the World where different 
reporting rules apply.

When applied to the full US GAAP taxonomy [1] a test run shows that 
turtle generation took 2.84 seconds, and found 0 facts, 12800 
concepts, 61649 links, 738 xlinks, 61649 arcs, 62264 locators and 
14119 resources, resulting a pretty big turtle file (20Mb). I am 
hoping to get permission to release this tool as open source, but it 
may take a little while to get permission from my employer.

[1] http://xbrl.us/documents/XBRLUSGAAPTaxonomies-2008-03-31.zip

Here are some sample extracts from autogenerated turtle:

# a concept

mr:AuditorInformationParagraph [
     rdf:type xbrli:stringItemType;
     xbrli:periodType "duration".
     ].

# a relationship between concepts

_:link61648 arcrole:parent-child [
     xl:type xl:link;
     xbrl:role role4:CommonDomainMembers;
     xbrl:order "210.0"^^xsd:decimal;
     xbrl:from us-gaap:ClassOfStockDomain;
     xbrl:to us-gaap:SeriesGPreferredStockMember.
     ].

# a label in US English

_:link2730 arcrole:concept-label [
     xl:type xl:link;
     xbrl:role role1:link;
     xlink:role role1:label;
     rdf:lang "en-US";
     xbrl:order "1.0"^^xsd:decimal;
     xbrl:from us-gaap:EnergyMarketingContractsAssetsCurrent;
     xbrl:resource """Energy Marketing Contracts
                      Assets, Current"""@en-US.
     ].

# a context from an instance file with an XML Literal
# and date range. Further work is needed to move XML
# namespace declarations into the XML Fragment

_:context_c002 [
     xl:type xbrli:context;
     xbrli:entity [
         xbrli:identifier "none";
         xbrli:scheme <http://www.myurl.com>.
         ];
     xbrli:scenario """
<asi:scenarioName>Actual</asi:scenarioName>
"""^^rdf:XMLLiteral;
     xbrli:period (
         [ xbrli:startDate "2007-01-01"^^xsd:date;
          xbrli:endDate "2007-03-31"^^xsd:date. ]
         ).
     ].

# some units
_:unit_u002 xbrli:measure iso4217:USD.
_:unit_u003 xbrli:measure xbrli:shares.

# a numeric fact with XBRL's approach to monetary values

_:fact103 [
     xl:type xbrli:fact;
     rdf:type usfr-pte:TotalCurrentAssets;
     rdf:value "1569000000"^^xsd:integer;
     xbrli:decimals "-6"^^xsd:integer;
     xrbli:unit _:unit_u001;
     xrbli:context _:context_c003.
     ].

Turtle is *much* easier to read than the original XML syntax which 
is very opaque. It is a shame that Turtle wasn't around when 
XBRL.org started work, but that's history for you.

  Dave Raggett <dsr@w3.org> http://www.w3.org/People/Raggett

Received on Saturday, 20 September 2008 15:50:12 UTC