Re: [SKOS] 3 June Editors' Draft text and python files

It looks like Alistair designed semantics.py and semanticsxsl.py to be
used like a library, which makes sense since they are autogenerated.

So you will need to write a little script that imports the
semantics.py or semanticsxsl.py, gets the graph with the schema()
function from the respective library, and then does something with it,
like output it as n3.

So for example you ought to be able to put this script in the same
directory as semantics.py, and run it:

  import semantics

  graph = semantics.schema()
  graph.bind('skos', 'http://www.w3.org/2008/05/skos#')
  graph.bind('owl', 'http://www.w3.org/2002/07/owl#')
  print graph.serialize(format='n3')

The binds are in there so you get nice 'skos:' and 'owl:' prefixes in
your output. When you run that you ought to see pretty n3 for the skos
vocabulary :-)

I hope this helped.

//Ed

On Tue, Jun 10, 2008 at 4:47 AM, Thomas Baker
<baker@sub.uni-goettingen.de> wrote:
>
> On Wed, Jun 04, 2008 at 10:23:16PM +0100, Alistair Miles wrote:
>> All the prose statements of the SKOS and XL data models are extracted as a
>> single text file at:
>>
>> <http://www.w3.org/2006/07/SWD/SKOS/reference/20080603/semantics.txt>
>>
>> ...which I used to generate separate python scripts for SKOS and XL triples
>> at:
>>
>> <http://www.w3.org/2006/07/SWD/SKOS/reference/20080603/semantics.py>
>> <http://www.w3.org/2006/07/SWD/SKOS/reference/20080603/semanticsxl.py>
>>
>> .. I can't remember exactly what you need for your SKOS-learner tool, let me
>> know what I can do ... I should be able to generate any text-representation
>> of the triples pretty easily from the python scripts.
>
> Having installed http://rdflib.net/, "python ./semantics.py"
> now generates no errors - but also no visible output, neither to
> STDOUT nor to a file.  What am I missing?
>
> Tom
>
> --
> Tom Baker - tbaker@tbaker.de - baker@sub.uni-goettingen.de

Received on Tuesday, 10 June 2008 14:03:16 UTC