This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div vocab="http://example.com/eg/elements/1.1/"> | |
<h3 property="title">5 Centimeters Per Second</h3> | |
<h4 property="maker">Makoto Shinkai</h4> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ jruby -v | |
jruby 1.7.0.preview2.dev (ruby-1.9.3-p203) (2012-07-03 a364a87) (OpenJDK 64-Bit Server VM 1.7.0_03) [linux-amd64-java] | |
$ jruby test.rb | |
==== Text in English ==== | |
#<MatchData "@chichi dog dog" 1:"@" 2:"chichi" 3:" dog dog"> | |
1. 11 | |
2. 12 | |
3. 18 | |
==== Text in Chinese ==== | |
#<MatchData "@chichi 狗狗" 1:"@" 2:"chichi" 3:" 狗狗"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
array_size = 32768 | |
data = Array.new(array_size) | |
array_size.times { |c| data[c] = rand(256)} | |
data_sorted = data.sort | |
def sum(array) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Explanation: | |
# ASK returns 'true' if there are any results | |
# The inner query says: | |
# Get agents and (if there) bio:event | |
# Count agents and bios, and check if there are agents present, but no bios | |
PREFIX foaf: <http://xmlns.com/foaf/0.1/> | |
PREFIX bio: <http://purl.org/vocab/bio/0.1/> | |
ASK { | |
SELECT (count(?x) as ?agents) (count(?y) as ?bios) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.ilrt.researchrevealed.describehandler; | |
import com.hp.hpl.jena.query.Dataset; | |
import com.hp.hpl.jena.rdf.model.Model; | |
import com.hp.hpl.jena.rdf.model.ModelFactory; | |
import com.hp.hpl.jena.rdf.model.RDFNode; | |
import com.hp.hpl.jena.rdf.model.Resource; | |
import com.hp.hpl.jena.rdf.model.Statement; | |
import com.hp.hpl.jena.rdf.model.StmtIterator; | |
import com.hp.hpl.jena.rdf.model.impl.StmtIteratorImpl; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ java -jar eulergui-1.9-SNAPSHOT-jar-with-dependencies.jar | |
Oct 03, 2011 3:49:35 PM eulergui.project.ProjectFactory restoreXMLFile | |
INFO: opening Project from "/home/pldms/Downloads/euler_project.xml.n3p" ( file:/home/pldms/Downloads/euler_project.xml.n3p ) | |
Oct 03, 2011 3:49:35 PM eulergui.project.ProjectFactory restoreXMLFile | |
INFO: Blank Project created: /home/pldms/Downloads/euler_project.xml.n3p | |
Oct 03, 2011 3:49:35 PM eulergui.project.ProjectChangeSupport addProjectListener | |
INFO: ProjectChangeSupport.addProjectListener(): added listener eulergui.project.ProjectState@1f488344 | |
Oct 03, 2011 3:49:35 PM eulergui.project.ProjectChangeSupport addProjectListener | |
INFO: ProjectChangeSupport.addProjectListener(): added listener eulergui.project.ProjectState@1f488344 | |
Oct 03, 2011 3:49:35 PM eulergui.project.ProjectChangeSupport addProjectListener |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.rootdev.arpstax; | |
import java.util.Iterator; | |
import javax.xml.namespace.QName; | |
import javax.xml.stream.XMLEventReader; | |
import javax.xml.stream.XMLInputFactory; | |
import javax.xml.stream.XMLStreamException; | |
import javax.xml.stream.XMLStreamReader; | |
import javax.xml.stream.events.Attribute; | |
import javax.xml.stream.events.Characters; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ export CLASSPATH=~/.m2/repository/com/hp/hpl/jena/tdb/0.8.11-SNAPSHOT/tdb-0.8.11-SNAPSHOT.jar:~/.m2/repository/com/hp/hpl/jena/arq/2.8.9-SNAPSHOT/arq-2.8.9-20110816.103635-29.jar:~/.m2/repository/com/hp/hpl/jena/jena/2.6.4/jena-2.6.4.jar:~/.m2/repository/com/hp/hpl/jena/iri/0.8/iri-0.8.jar:~/.m2/repository/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar:~/.m2/repository/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar:~/.m2/repository/log4j/log4j/1.2.16/log4j-1.2.16.jar:~/.m2/repository/xerces/xercesImpl/2.7.1/xercesImpl-2.7.1.jar:~/.m2/repository/com/ibm/icu/icu4j/3.4.4/icu4j-3.4.4.jar:~/.m2/repository/org/apache/lucene/lucene-core/3.0.2/lucene-core-3.0.2.jar | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10000.times do |i| | |
print '.' | |
result1 = system './s-put', 'http://localhost:3030/ds', 'http://example.com/graph', 'D.nt' | |
result2 = system './s-delete', 'http://localhost:3030/ds', 'http://example.com/graph' | |
if (!result1 || !result2) then | |
STDERR.puts '\nFailed' | |
exit 1 | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -O http://openjena.org/repo-dev/com/hp/hpl/jena/tdb/0.8.10-SNAPSHOT/tdb-0.8.10-20110325.114138-12.zip | |
... | |
$ unzip tdb-0.8.10-20110325.114138-12.zip | |
... | |
$ export TDBROOT=TDB-0.8.10-SNAPSHOT | |
$ PATH=$TDBROOT/bin:$PATH | |
$ curl -O http://downloads.dbpedia.org/3.6/en/external_links_en.nt.bz2 | |
$ curl -O http://downloads.dbpedia.org/3.6/en/article_categories_en.nt.bz2 | |
$ curl -O http://downloads.dbpedia.org/3.6/en/homepages_en.nt.bz2 | |
$ bzcat *.bz2 | tdbloader2 --loc DBpedia /dev/stdin |