<commit_before><?php

include '../nixtape/config.php';
include '../nixtape/database.php';
include '../nixtape/utils/linkeddata.php';

function htmlnumericentities($str)
{ 
	return preg_replace('/[^!-%\x27-;=?-~ ]/e', '"&#".ord("$0").chr(59)', $str); 
}

$username = $argv[1];
if (! $username)
{
	die("Must provide a username.\n");
}

$user = new User($username);
$scrobbles = $user->getScrobbles(10000);

print "<rdf:RDF
	xmlns=\"http://purl.org/ontology/mo/\"
	xmlns:bio=\"http://purl.org/vocab/bio/0.1/\"
	xmlns:dc=\"http://purl.org/dc/terms/\"
	xmlns:foaf=\"http://xmlns.com/foaf/0.1/\"
	xmlns:gob=\"http://purl.org/ontology/last-fm/\"
	xmlns:mo=\"http://purl.org/ontology/mo/\"
	xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"
	xmlns:sioc=\"http://rdfs.org/sioc/ns#\"
	xmlns:rss=\"http://purl.org/rss/1.0/\"
	xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"<commit_msg>Catch User::__construct() Exceptions in users_dump_rdf.php script.<commit_after><?php

include '../nixtape/config.php';
include '../nixtape/database.php';
include '../nixtape/utils/linkeddata.php';

function htmlnumericentities($str)
{ 
	return preg_replace('/[^!-%\x27-;=?-~ ]/e', '"&#".ord("$0").chr(59)', $str); 
}

$username = $argv[1];
if (! $username)
{
	die("Must provide a username.\n");
}

try {
	$user = new User($username);
} catch (Exception $e) {
	die("No such user.\n");
}

$scrobbles = $user->getScrobbles(10000);

print "<rdf:RDF
	xmlns=\"http://purl.org/ontology/mo/\"
	xmlns:bio=\"http://purl.org/vocab/bio/0.1/\"
	xmlns:dc=\"http://purl.org/dc/terms/\"
	xmlns:foaf=\"http://xmlns.com/foaf/0.1/\"
	xmlns:gob=\"http://purl.org/ontology/last-fm/\"
	xmlns:mo=\"http://purl.org/ontology/mo/\"
	xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"
	xmlns:sioc=\"http://rdfs.org/sioc/ns#\"
	xmlns:rss=\"http://purl.org/rss/1.0/\"
	xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"
{'fraction_non_alphanumeric': 0.2766295707472178, 'fraction_numerical': 0.034976152623211444, 'mean_word_length': 3.865979381443299, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 22}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4302477', 'n_tokens_mistral': 871, 'n_tokens_neox': 836, 'n_words': 89}