Created
April 27, 2012 09:47
-
-
Save njh/2507922 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/perl | |
use strict; | |
open(TSV, "freebase-sameas-dbpedialite-20120424.tsv") or die "Failed to open file: $!"; | |
my %map; | |
while(<TSV>) { | |
my ($freebase, $dbpedialite) = split(/\s+/); | |
if ($dbpedialite =~ m|http://dbpedialite.org/things/(\d+)|) { | |
$map{$1} = $freebase; | |
} | |
} | |
close(TSV); | |
foreach my $key (sort { $a <=> $b } keys %map) { | |
print "<http://dbpedialite.org/things/$key#id> <http://www.w3.org/2002/07/owl#sameAs> <".$map{$key}."> .\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment