Giter VIP home page Giter VIP logo

Comments (9)

abrisse avatar abrisse commented on August 24, 2024

You need to define a default repository.

from spira.

ranielli avatar ranielli commented on August 24, 2024

Eu ja defini em um arquivo de configuração , ja consigo gravar normalmente, mais para recuperar pelo SPIRA ainda não.

require 'rdf/rdfa'

require 'rdf'

#Url para realizar a conexao com o Allegro graph
REPO_URL = "http://teste:[email protected]:10035/repositories/projetos_rdf"

#Utilzizando o rdf.rb para se conectar com o Allegrograph
REPO = RDF::AllegroGraph::Repository.new(REPO_URL)

FOAF = RDF::FOAF # Standard "friend of a friend" vocabulary
DOAP = RDF::DOAP #
RDFS = RDF::RDFS
SKOS = RDF::SKOS

Spira.add_repository! :default, REPO

from spira.

abrisse avatar abrisse commented on August 24, 2024

You need to define a type for your Class in order for Spira to understand what you are looking for.

Example :

class Tag < Spira::Base
  ...
  type RDF::URI.new("http://www.xpto.com/ontology#Tag")
end

from spira.

ranielli avatar ranielli commented on August 24, 2024

The type must be the same class name?

from spira.

abrisse avatar abrisse commented on August 24, 2024

It just need to be an URI. See https://github.com/ruby-rdf/spira#type

from spira.

ranielli avatar ranielli commented on August 24, 2024

Ok thanks

from spira.

ranielli avatar ranielli commented on August 24, 2024

class Tag < Spira::Base
configure :base_uri => "http://www.xpto.com/tags"
type RDF::URI.new("http://www.xpto.com/ontology#Tag")

property :preferred_label, :predicate => SKOS.prefLabel, :type => XSD.string
property :alternative_labels, :predicate => SKOS.altLabel, :type => XSD.string
end

class TagsController < ApplicationController

def index
@tag = Tag.all
end
end

Index.html.erb

table>
<% @tag.each do |t| %>

<%= t %>

<% end %>

Result in HTML is #Tag:0x007f7a9822c3a0, is necessary create metodo for get data in class TAG?

from spira.

abrisse avatar abrisse commented on August 24, 2024

Rails Tutorial : http://guides.rubyonrails.org/layouts_and_rendering.html

from spira.

ranielli avatar ranielli commented on August 24, 2024

Ok . I could thank you, sorry for the questions, but I'm beginner

from spira.

Related Issues (20)

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.