Coder Social home page Coder Social logo

rdf-sesame's People

Contributors

abrisse avatar artob avatar berezovskyi avatar danny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rdf-sesame's Issues

Optimize triple pattern queries

This adapter is not yet optimized for RDF.rb 0.2.x's enhanced query APIs; this may adversely affect triple pattern query performance.

This should be addressed in an upcoming version.

Deleting statements in a context

With the RDF::Repository, I can set a context with the #set_context method. After than, every statement I'm going to insert into the repository will be assigned this context.

But when I delete statements from the repository, the context that is used to delete the statements is the one already assigned to the statement (RDF::Statement#context= or #graph=). So the two operations are not symmetric at all.

I'm going to do a PR in a few to adjust that behavior.

Infinite loop when accessing statements or graphs of a Sesame repository.

I can't get the contexts used inside a Sesame repository anymore. It loops infinitely until the stack level is too deep and it raises an error. It does the same when I try to list the statements using '#each_statement".

The code to trigger this behavior is pretty simple:

server = RDF::Sesame::Server.new(db_url)
repository = server.repository(repository_name')

# either this
repository.each_statement do |s| # <= each starts the infinite loop 
  puts s.inspect
end

# or this
puts repository.graph_names.inspect

I'm pushing a PR in a few minutes, I'll reference this issue.

Implement support for persistent HTTP connections

Currently, connections are internally implemented using Net::HTTP from Ruby's standard library, and connections are always transient, i.e. they do not persist from one request to the next and must always be reopened when used.

We should implement support for persistent Keep-Alive connections as a future improvement.

Optimize bulk operations

This adapter is not yet optimized for RDF.rb 0.2.x's bulk-operation APIs, meaning that statement insertions and deletions are currently performed one by one; this may affect the performance of loading large datasets into Sesame.

This should be addressed in an upcoming version.

Bug inserting RDF-XML based graphs or reader into repositories

Bug inserting RDF-XML based graphs into repositories.

I am able to insert NTriple based readers into a Sesame repository. However, RDFXML ones cannot be inserted. Here's what I've been trying:
require 'rdf'
require 'rdf/sesame'
require 'rdf/rdfxml'
repository = RDF::Sesame::Repository.new('http://localhost:8080/openrdf-sesame/repositories/test')

Successfully returns count of 47

reader = RDF::NTriples::Reader.new(File.read(RAILS_ROOT + '/public/doap.nt'))
repository.clear
repository.insert(reader)
repository.count

Only returns count of 3

reader = RDF::RDFXML::Reader.new(File.read(RAILS_ROOT + '/public/doap.xml'))
repository = RDF::Sesame::Repository.new('http://localhost:8080/openrdf-sesame/repositories/test')
repository.clear
repository.insert(reader)
repository.count

Graph count returns 47, but insertion into repository fails

stream = File.open(RAILS_ROOT + '/public/doap.xml')
graph = RDF::Graph.new
RDF::RDFXML::Reader.new(stream).each { |s| graph << s }
puts graph.count

Now that we have a graph, insert into repository

This inserts 3 entries, but not the entire 47

repository.clear
repository.insert(graph.to_a)
repository.count

Same thing, returns 3

repository.clear
repository.insert(*graph.to_a)
repository.count

Same thing, returns 3

repository.clear
repository<<graph.to_rdf
repository.count

The << method in writable.rb looks like it detects a graph and then

calls insert_graph, but none of these seem to work either

repository<<graph
repository.insert(graph)
repository.insert(graph.to_ntriples)
repository.insert(_graph.to_ntriples)
graph.each { |s| repository << s }
graph.each { |s| repository.insert(_s) }
graph.each { |s| repository.insert(s) }

stream = File.open(RAILS_ROOT + '/public/doap.xml')
graph = RDF::Graph.new
RDF::RDFXML::Reader.new(stream).each { |s| graph << s }
reader = RDF::NTriples::Reader.new(graph.to_ntriples)
repository.insert(reader)

I am able to get this to work with the RDF Context gem:
require 'rdf'
require 'rdf/sesame'
require 'rdf_context'
url = "http://localhost:8080/openrdf-sesame/repositories/test"
repository = RDF::Sesame::Repository.new(url)

The doap.xml file fails but rdf.xml does get parsed correctly

f = File.open(RAILS_ROOT + '/public/rdf.xml')
graph = RdfContext::Graph.new
graph.parse(f.read, nil, :type => :rdfxml)

statements = RDF::NTriples::Reader.new(graph.to_ntriples)
repository.insert(*statements)
repository.count
repository.clear!

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.