W3C home > Mailing lists > Public > public-swd-wg@w3.org > June 2008

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

From: Ed Summers <ehs@pobox.com>
Date: Tue, 10 Jun 2008 10:02:34 -0400
Message-ID: <f032cc060806100702m108010c1uc53840749a05580@mail.gmail.com>
To: "SWD WG" <public-swd-wg@w3.org>

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:07:53 UTC