Giter Site home page Giter Site logo

pragmatic_context's People

Contributors

mtrudel avatar dchandekstark avatar

Stargazers

Daniel Portales avatar Olibia Tsati avatar Alexandre Rousseau avatar Travis Taylor avatar Devsbrain avatar Matt Morris avatar Gabriel Mazetto avatar  avatar Alfredo Serafini avatar Thom avatar Marcin Kalita avatar tamsin woo avatar Jesús García Crespo avatar Jon Stroop avatar María A. Matienzo avatar Petri Kola avatar Thomas Efer avatar John Fink avatar Benjamin Bock avatar Scott Matthewman avatar Gregg Kellogg avatar Graham Faulkner avatar Tom Demeranville avatar Markus Lanthaler avatar Mikey avatar Peter Ansell avatar Matteo Collina avatar Shawn Averkamp avatar Nick Ruest avatar

Watchers

Benjamin Bock avatar Gregg Kellogg avatar liad avatar  avatar Devsbrain avatar Thom avatar tamsin woo avatar  avatar

pragmatic_context's Issues

Namespace Collision (& Related Development FYI)

First off, I wanted to let you know that I'm working on ensuring compatibility between pragmatic_context and the newly minted active-triples gem. I have a branch in place with appropriate tests. Any feedback is welcome.

I'm dealing with a namespace conflict on #context between RDF::Graph and PragmaticContext::Contextualizable. They use it, of course, in very different ways and the effect is that including Contextualizable breaks my models. This may not be an issue you are interested in dealing with on your end, but I figured It couldn't hurt to make you aware of the conflict.

jsonld_context should also be a class method

It's not dependent on instance attributes, and it's awkward to instantiate a model in order to produce a context document -- e.g. to serve at a URL, so that API responses can use the Link header instead of embedding the context.

Add support for compacting nested Hash objects

This will help cleanly support @mjsuhonos' use case, namely:

{
    "@id" : "http://some.uri/a_book",
    "@type" : "http://schema.org/Book",
    "@context" : {
        "mods" : "http://www.loc.gov/mods/rdf/v1#"
    },
    "mods:title" : "Of Mice and Men"
}

I suspect that the DSL for this would look like:

class Resource
  field :mods, :type => Hash
  contextualize :mods, :as => "http://www.loc.gov/mods/rdf/v1#', :compact => true
end

Define a canonical serializer

We have a need to serialize consistently, as leaving it to the user is error prone and not the simplest thing for many cases.

Define an as_jsonld method in a separate mixin that builds an object consisting of contextualized terms, and properly compacts hashes where indicated.

Also, ensure that it properly walks embedded documents

Add a section to the documentation to describe the use case

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.