<commit_before><?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Migrating from Jena 1 to Jena 2</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body xml:lang="en" lang="en" bgcolor="#FFFFFF">
		<h1 style="text-align: center; line-height: 18pt">Migrating from Jena1  to Jena 2</h1>
		<p>Jena 2 supports the Jena 1 API. However a number of changes have been made that will cause existing code not to run out of the box. The Jena team expect that there will be tools to help with the migration of Jena 1 code, but they don't exist yet, as we are not encouraging folks to migrate.</p>
		<p>The changes are conceptually minor, mostly just renaming things into a more sensible pattern.
        Exceptions are reification and a bug fix on the I/O API.
                </p>
		<h2>What Must be changed:</h2>
		<h3>package renaming:</h3>
		<ul>
			<li>com.hp.hpl.mesa.rdf.jena.model -&gt; com.hp.hpl.jena.rdf.model</li>
			<li>com.hp.hpl.mesa.rdf.jena.vocabulary -&gt; com.hp.hpl.jena.vocabulary</li>
		</ul>
		<h3>new model factory:</h3>
		<ul>
			<li>Models in Jena 1 were created using new on the model class.
			With Jena 2 there is factory for creating new models
			com.hp.hpl.jena.rdf.model.ModelFactory. Use that instead of new.
			If for some reason you don't want to do that, the memory model
			class has moved to com.hp.hpl.jena.mem.</li>
		</ul>
		<h3>iterators now implement java.util.iterator</h3>
		<ul>
			<li>which means the .next() method returns an Object rather than a typed object.
			You need to either cast the return from the .next() method to the
			appropriate type or use the .next<i>Type</i>() (where <i>Type</i>
			is Resource, Literal, Ns, RDFNode or Statement depending on the
			iterator) to avoid casting.</li>
		</ul>
		<h3>DAMLSelector has gone</h3>
		<ul>
		<li>
			DAMLSelector has been eliminated; SimpleSelector on a DAML (or
			OWL) model will do an almost equivalent job, because those
			models infer the necessary transitive triples.
		</li>
		</ul>
		<h3>I/O bug fix</h3>
		<ul>
			<li>java.io.Reader -&gt; java.io.InputStream etc.</li>
			<li>java.io.Writer -&gt; java.io.OutputStream etc.</li>
		</ul>
                <p>Changes in the RDF/XML parser now mean that (the frequent)
                character encoding problems related to use of java.io.FileReader
                are reported. Changes in the RDF/XML output means that the
                not-so-very-portable character encoding used in a java.io.FileWriter
                is explicit in the XML document. See
				<a href="IO/iohowto.html#rush">the IO mini HowTo</a>
                for more explanation.</p>

		<h3>reification changes</h3>
			Statements are no longer Resources. Instead Statements can be
			converted into Resources using the asResource() method. These
			new Resources are <i>ReifiedStatement</i> objects. See
			<a href="reify-api.html">the API proposal</a> document for
			the moment.

		<h3>Statement.set</h3><commit_msg>Added note to say that .util.Log is withdrawn (use log4j).<commit_after><?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Migrating from Jena 1 to Jena 2</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body xml:lang="en" lang="en" bgcolor="#FFFFFF">
		<h1 style="text-align: center; line-height: 18pt">Migrating from Jena1  to Jena 2</h1>
		<p>Jena 2 supports the Jena 1 API. However a number of changes have been made that will cause existing code not to run out of the box. The Jena team expect that there will be tools to help with the migration of Jena 1 code, but they don't exist yet, as we are not encouraging folks to migrate.</p>
		<p>The changes are conceptually minor, mostly just renaming things into a more sensible pattern.
        Exceptions are reification and a bug fix on the I/O API.
                </p>
		<h2>What Must be changed:</h2>
		
		<h3>package renaming:</h3>
		<ul>
			<li>com.hp.hpl.mesa.rdf.jena.model -&gt; com.hp.hpl.jena.rdf.model</li>
			<li>com.hp.hpl.mesa.rdf.jena.vocabulary -&gt; com.hp.hpl.jena.vocabulary</li>
		</ul>
		
		<h3>logging uses log4j</h3>

		The old logging package in <strong>.util.Log</strong> has been
		removed. Jena now uses <strong>log4j</strong> for its logging. Any
		users who used the old logging package should switch to log4j.
		
		<h3>new model factory:</h3>
		<ul>
			<li>Models in Jena 1 were created using new on the model class.
			With Jena 2 there is factory for creating new models
			com.hp.hpl.jena.rdf.model.ModelFactory. Use that instead of new.
			If for some reason you don't want to do that, the memory model
			class has moved to com.hp.hpl.jena.mem.</li>
		</ul>
		
		<h3>iterators now implement java.util.iterator</h3>
		<ul>
			<li>which means the .next() method returns an Object rather than a typed object.
			You need to either cast the return from the .next() method to the
			appropriate type or use the .next<i>Type</i>() (where <i>Type</i>
			is Resource, Literal, Ns, RDFNode or Statement depending on the
			iterator) to avoid casting.</li>
		</ul>
		
		<h3>DAMLSelector has gone</h3>
		<ul>
		<li>
			DAMLSelector has been eliminated; SimpleSelector on a DAML (or
			OWL) model will do an almost equivalent job, because those
			models infer the necessary transitive triples.
		</li>
		</ul>
		
		<h3>I/O bug fix</h3>
		<ul>
			<li>java.io.Reader -&gt; java.io.InputStream etc.</li>
			<li>java.io.Writer -&gt; java.io.OutputStream etc.</li>
		</ul>
                <p>Changes in the RDF/XML parser now mean that (the frequent)
                character encoding problems related to use of java.io.FileReader
                are reported. Changes in the RDF/XML output means that the
                not-so-very-portable character encoding used in a java.io.FileWriter
                is explicit in the XML document. See
				<a href="IO/iohowto.html#rush">the IO mini HowTo</a>
                for more explanation.</p>

		<h3>reification changes</h3>
			Statements are no longer Resources. Instead Statements can be
			converted into Resources using the asResource() method. These
			new Resources are <i>ReifiedStatement</i> objects. See
			<a href="reify-api.html">the API proposal</a> document for
			the moment.

		<h3>Statement.set</h3>
{'fraction_non_alphanumeric': 0.1164682838631912, 'fraction_numerical': 0.01657375320174778, 'mean_word_length': 3.095003084515731, 'pattern_counts': {'":': 0, '<': 143, '<?xml version=': 2, '>': 143, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 6}, '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': '6771674', 'n_tokens_mistral': 2441, 'n_tokens_neox': 2177, 'n_words': 783}