Skip to content

Instantly share code, notes, and snippets.

View danbri's full-sized avatar

Dan Brickley danbri

View GitHub Profile
@danbri
danbri / gist:883075
Created March 23, 2011 13:18
mahout early tests
package tv.notube;
import org.apache.mahout.common.RandomUtils;
import org.apache.mahout.cf.taste.impl.recommender.slopeone.SlopeOneRecommender;
import org.apache.mahout.cf.taste.impl.recommender.svd.Factorizer;
import org.apache.mahout.cf.taste.impl.recommender.svd.SVDRecommender;
import org.apache.mahout.cf.taste.impl.recommender.svd.ALSWRFactorizer;
import org.apache.mahout.cf.taste.impl.recommender.svd.ExpectationMaximizationSVDFactorizer;
import org.apache.mahout.cf.taste.common.TasteException;
import org.apache.mahout.cf.taste.eval.IRStatistics;
b00747pc, b0074c4c, 0.11538461538461539
b00747pc, b007cgz6, 0.11023622047244094
b00747pc, b00qymct, 9.75609756097561E-4
b00747pc, b00r3rzv, 9.689922480620155E-4
b00747pc, b00r3tfz, 9.560229445506692E-4
b00747pc, b00r7lv6, 9.191176470588235E-4
b00747pc, b00r7pj0, 7.31528895391368E-4
b00747pc, b00r7skp, 9.9601593625498E-4
b00747pc, b00rl4d6, 8.012820512820513E-4
b00747pc, b00rp1tq, 9.784735812133072E-4
<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="urn:foo#ns">
<rdf:Description rdf:nodeID="a1"><foo rdf:nodeID="a1"/></rdf:Description>
<rdf:Description rdf:nodeID="a1"><foo rdf:nodeID="a5"/></rdf:Description>
<rdf:Description rdf:nodeID="a1"><foo rdf:nodeID="a1"/></rdf:Description>
<rdf:Description rdf:nodeID="a3"><foo rdf:nodeID="a1"/></rdf:Description>
<rdf:Description rdf:nodeID="a3"><foo rdf:nodeID="a4"/></rdf:Description>
<rdf:Description rdf:nodeID="a5"><foo rdf:nodeID="a1"/></rdf:Description>
<rdf:Description rdf:nodeID="a1"><foo rdf:nodeID="a2"/></rdf:Description>
<http://schema.org/HobbyShop> <http://schema.org/Store>
<http://schema.org/HairSalon> <http://schema.org/HealthAndBeautyBusiness>
<http://schema.org/Event> <http://schema.org/Thing>
<http://schema.org/LakeBodyOfWater> <http://schema.org/BodyOfWater>
<http://schema.org/MusicPlaylist> <http://schema.org/CreativeWork>
<http://schema.org/GeneralContractor> <http://schema.org/ProfessionalService>
<http://schema.org/GeneralContractor> <http://schema.org/HomeAndConstructionBusiness>
<http://schema.org/DepartmentStore> <http://schema.org/Store>
<http://schema.org/BuddhistTemple> <http://schema.org/PlaceOfWorship>
<http://schema.org/ProfilePage> <http://schema.org/WebPage>
#!/usr/bin/perl
use strict;
use warnings;
use RDF::Trine;
use RDF::Query;
use HTML::HTML5::Microdata::Parser;
my $html;
my $baseURI='http://schema.org/';
#!/usr/bin/env ruby
def out(str)
str = str.join(' ; ')
# return str.gsub(/http:\/\/schema\.org\//,"")
end
base = 'http://schema.org/'
ix = {}
f = File.read('_types.txt').each do |line|
#!/usr/bin/perl
use strict;
use warnings;
use RDF::Trine;
use RDF::Query;
use HTML::HTML5::Microdata::Parser;
my $html;
my $baseURI='http://schema.org/';
#!/usr/bin/perl
use strict;
use warnings;
use RDF::Trine;
use RDF::Query;
use HTML::HTML5::Microdata::Parser;
my $html;
my $baseURI='http://schema.org/';
From http://www.whatwg.org/specs/web-apps/current-work/multipage/links.html#names:-the-itemprop-attribute
<div itemscope itemref="x">
<p itemprop="b">test</p>
<p itemprop="a">2</p>
</div>
<div id="x">
<p itemprop="a">1</p>
</div>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
select ?t ?l where {
{ ?t a rdf:Property . }
UNION
{ ?t a owl:Property . }