Code Monkey home page Code Monkey logo

rdf-yoda_triples's Introduction

Yoda Triples

Object Subject Predicate, mmgh?

This way Yoda speaks: http://en.wikipedia.org/wiki/Object%E2%80%93subject%E2%80%93verb#Fictitious_languages.

Usage

graph = RDF::Graph.new
graph << RDF::Statement(RDF::URI('http://example.org/yoda'), RDF.type, RDF::URI('http://example.org/jedi'))
graph.dump :yodatriples
# => "<http://example.org/jedi> <http://example.org/yoda> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> mmgh?\n"

reader = RDF::Reader.for(:yodatriples)
reader.new(graph.dump(:yodatriples)).each_statement do |statement|
  puts statement.inspect
end

Specification

For more information, see the RDF 1.1 Y-Triples draft specification.

License

This is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.

rdf-yoda_triples's People

Contributors

zimeon avatar anarchivist avatar

Stargazers

Tazro Inutano Ohta avatar Angus H. avatar Arto Bendiken avatar Michael B. Klein avatar  avatar Gregg Kellogg avatar Jon Stroop avatar Tod Robbins avatar

Watchers

Gregg Kellogg avatar James Cloos avatar tamsin woo avatar

rdf-yoda_triples's Issues

RDF::YodaTriples should discourage using faster, quicker serializations

< If you choose the quick and easy path as
Vader did - you will become an agent of evil. >
        \
         \         ____
          \     _.' :  `._
            .-.'`.  ;   .'`.-.
   __      / : ___ ;  /___ ;  \      __
 ,'_ ""--.:__;".-.";: :".-.":__;.--"" _`,
 :' `.t""--.. '<@.`;_  ',@>` ..--""j.' `;
      `:-.._J '-.-'L__ `-- ' L_..-;'
        "-.__ ;  .-"  "-.  : __.-"
            L ' /.------. ' J
             "-.   "--"   .-"
            __.l"-:_JL_;-";.__
         .-j/'.;  ;""""  / .'"-.

Parsing YodaTriples should be an exercise in patience. Expedient serializations - and perhaps ones that are easy to read - should be discouraged.

RDF::YodaTriples fails to decompose copulae from compound predicative nominals

Simple predicative nominals such as A Jedi, Yoda is are handled correctly, but more complex predicative nominals embedding prepositional phrases, remain composed, e.g. To the dark side, fear is the path instead of To the dark side the path, fear is.

Steps to reproduce:

graph = RDF::Graph.new
graph << RDF::Statement(RDF::URI('http://example.org/yoda'),
                        RDF::RDFS.member,
                        RDF::URI('http://en.wikipedia.org/wiki/Galactic_Republic'))    
puts graph.dump :yodatriples

Expected: ‘Of the Galactic Republic a member Yoda is.’

<http://en.wikipedia.org/wiki/Galactic_Republic>
<http://www.w3.org/2000/01/rdf-schema#member>
<http://example.org/yoda>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>

Actual: ‘Of the Galactic Republic Yoda is a member.’

<http://en.wikipedia.org/wiki/Galactic_Republic>
<http://example.org/yoda>
<http://www.w3.org/2000/01/rdf-schema#member>

Note:

In defense of YodaTriples, Yoda doesn't get this right either.

image

Distinguish lexical form from N-Triples.

Any thought to distinguish the lexical form from N-Triples? For example, begin each line with y-.

Also, a mini-spec would be nice with some EBNF. Perhaps the following:

[1] yodaDoc ::= ytriple? (EOL triple)* EOL?
[2] ytriple ::= "y-" object subject predicate '.'
[3] subject ::= IRIREF | BLANK_NODE_LABEL
[4] predicate   ::= IRIREF
[5] object  ::= IRIREF | BLANK_NODE_LABEL | literal
[6] literal ::= STRING_LITERAL_QUOTE ('^^' IRIREF | LANGTAG)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.