root / rdfalchemy / trunk / rdfalchemy / samples / company.py

Revision 98, 1.3 kB (checked in by phil, 11 months ago)

This reflects a change of all Descriptor names from a prefix of rdflib to rdf
This fixes improves the behavior of Literal for Decimal and datetime types
It also moves rdfSubject into a different file name
adds one unit test for literals

Line 
1
2from rdflib import Literal, BNode, Namespace, URIRef
3
4# this has the rdfSubject stuff and the Fresnel stuff
5from rdfalchemy import *
6
7
8ov = Namespace("http://owl.openvest.org/2005/10/Portfolio#")
9edgarns = Namespace('http://www.sec.gov/Archives/edgar')
10
11class Company(rdfSubject):
12    rdf_type = ov.Company
13    symbol = rdfSingle(ov.symbol,)
14    cik = rdfSingle(ov.secCik,'cik')
15    companyName = rdfSingle(ov.companyName,'companyName')
16    stockDescription = rdfSingle(ov.stockDescription,'stockDescription')
17    stock = rdfMultiple(ov.hasIssue)
18       
19                                                                                                                                       
20
21class EdgarFiling(rdfSubject):
22    rdf_type = edgarns.xbrlFiling
23    accessionNumber = rdfSingle(edgarns.accessionNumber)
24    companyName = rdfSingle(edgarns.companyName)
25    filingDate = rdfSingle(edgarns.filingDate)
26    formType = rdfSingle(edgarns.formType)
27                                                                                                                                                                                                                                                                                                                                                                   
Note: See TracBrowser for help on using the browser.