Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
CLEREZZA-983: changed casing to match incubating commons-rdf
  • Loading branch information
retog committed Apr 11, 2015
1 parent 12b3d66 commit e59c1ac0d4148c07433ba18e614753250bbb34f3
Showing 32 changed files with 206 additions and 206 deletions.
@@ -36,6 +36,6 @@
* @see <a href= "http://www.w3.org/TR/rdf11-concepts/#dfn-blank-node">RDF-1.1
* Blank Node</a>
*/
public class BlankNode implements BlankNodeOrIri {
public class BlankNode implements BlankNodeOrIRI {

}
@@ -25,6 +25,6 @@
*
* @author reto
*/
public interface BlankNodeOrIri extends RdfTerm {
public interface BlankNodeOrIRI extends RDFTerm {

}
@@ -45,8 +45,8 @@ public interface Graph extends Collection<Triple> {
* @param object
* @return <code>Iterator</code>
*/
public Iterator<Triple> filter(BlankNodeOrIri subject, Iri predicate,
RdfTerm object);
public Iterator<Triple> filter(BlankNodeOrIRI subject, IRI predicate,
RDFTerm object);

/**
* Returns true if <code>other</code> describes the same graph and will
@@ -31,11 +31,11 @@
*
* @author reto
*/
public class Iri implements BlankNodeOrIri, Serializable {
public class IRI implements BlankNodeOrIRI, Serializable {

private String unicodeString;

public Iri(String unicodeString) {
public IRI(String unicodeString) {
this.unicodeString = unicodeString;
}

@@ -56,11 +56,11 @@ public String getUnicodeString() {
@Override
public boolean equals(Object obj) {

if (!(obj instanceof Iri)) {
if (!(obj instanceof IRI)) {
return false;
}

return unicodeString.equals(((Iri) obj).getUnicodeString());
return unicodeString.equals(((IRI) obj).getUnicodeString());
}

/**
@@ -28,7 +28,7 @@
*
* @author reto
*/
public interface Literal extends RdfTerm {
public interface Literal extends RDFTerm {

/**
* The lexical form of this literal, represented by a <a
@@ -50,7 +50,7 @@ public interface Literal extends RdfTerm {
* href="http://www.w3.org/TR/rdf11-concepts/#dfn-datatype-iri">RDF-1.1
* Literal datatype IRI</a>
*/
Iri getDataType();
IRI getDataType();

/**
* If and only if the datatype IRI is <a
@@ -27,6 +27,6 @@
* @see <a href= "http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-term" >RDF-1.1
* Term</a>
*/
public interface RdfTerm {
public interface RDFTerm {

}
@@ -26,11 +26,11 @@
*/
public interface Triple {

BlankNodeOrIri getSubject();
BlankNodeOrIRI getSubject();

Iri getPredicate();
IRI getPredicate();

RdfTerm getObject();
RDFTerm getObject();

/**
*
@@ -18,10 +18,10 @@
*/
package org.apache.clerezza.commons.rdf.event;

import org.apache.clerezza.commons.rdf.BlankNodeOrIri;
import org.apache.clerezza.commons.rdf.RdfTerm;
import org.apache.clerezza.commons.rdf.BlankNodeOrIRI;
import org.apache.clerezza.commons.rdf.RDFTerm;
import org.apache.clerezza.commons.rdf.Triple;
import org.apache.clerezza.commons.rdf.Iri;
import org.apache.clerezza.commons.rdf.IRI;

/**
* The <code>FilterTriple</code> class provides a match()-method that tests
@@ -31,9 +31,9 @@
*/
public class FilterTriple {

private BlankNodeOrIri subject;
private Iri predicate;
private RdfTerm object;
private BlankNodeOrIRI subject;
private IRI predicate;
private RDFTerm object;

/**
* Creates a new <code>FilterTriple</code>. The specified subject,
@@ -44,7 +44,7 @@ public class FilterTriple {
* @param predicate the predicate.
* @param object the object.
*/
public FilterTriple (BlankNodeOrIri subject, Iri predicate, RdfTerm object) {
public FilterTriple (BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {
this.subject = subject;
this.predicate = predicate;
this.object = object;
@@ -18,10 +18,10 @@
import java.util.Collection;
import java.util.Objects;
import org.apache.clerezza.commons.rdf.BlankNode;
import org.apache.clerezza.commons.rdf.BlankNodeOrIri;
import org.apache.clerezza.commons.rdf.BlankNodeOrIRI;
import org.apache.clerezza.commons.rdf.ImmutableGraph;
import org.apache.clerezza.commons.rdf.Iri;
import org.apache.clerezza.commons.rdf.RdfTerm;
import org.apache.clerezza.commons.rdf.IRI;
import org.apache.clerezza.commons.rdf.RDFTerm;
import org.apache.clerezza.commons.rdf.Triple;
import org.apache.clerezza.commons.rdf.impl.utils.TripleImpl;
import org.apache.clerezza.commons.rdf.impl.utils.simple.SimpleGraph;
@@ -32,7 +32,7 @@
*/
class SparqlBNode extends BlankNode {

final static Iri internalBNodeId = new Iri("urn:x-internalid:fdmpoihdfw");
final static IRI internalBNodeId = new IRI("urn:x-internalid:fdmpoihdfw");

final ImmutableGraph context;
private final int isoDistinguisher;
@@ -41,8 +41,8 @@ class SparqlBNode extends BlankNode {
this.isoDistinguisher = isoDistinguisher;
final SimpleGraph contextBuider = new SimpleGraph();
for (Triple triple : context) {
BlankNodeOrIri subject = triple.getSubject();
RdfTerm object = triple.getObject();
BlankNodeOrIRI subject = triple.getSubject();
RDFTerm object = triple.getObject();
contextBuider.add(new TripleImpl(subject.equals(node) ? internalBNodeId : subject,
triple.getPredicate(),
object.equals(node) ? internalBNodeId : object));
@@ -32,9 +32,9 @@
import org.apache.http.util.EntityUtils;
import javax.xml.parsers.*;
import org.apache.clerezza.commons.rdf.BlankNode;
import org.apache.clerezza.commons.rdf.Iri;
import org.apache.clerezza.commons.rdf.IRI;
import org.apache.clerezza.commons.rdf.Language;
import org.apache.clerezza.commons.rdf.RdfTerm;
import org.apache.clerezza.commons.rdf.RDFTerm;
import org.apache.clerezza.commons.rdf.impl.utils.AbstractLiteral;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
@@ -51,7 +51,7 @@ public SparqlClient(final String endpoint) {
this.endpoint = endpoint;
}

List<Map<String, RdfTerm>> queryResultSet(final String query) throws IOException {
List<Map<String, RDFTerm>> queryResultSet(final String query) throws IOException {
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(endpoint);
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
@@ -91,22 +91,22 @@ List<Map<String, RdfTerm>> queryResultSet(final String query) throws IOException
final public static class SparqlsResultsHandler extends DefaultHandler {

private String currentBindingName;
private Map<String, RdfTerm> currentResult = null;
private final List<Map<String, RdfTerm>> results = new ArrayList<>();
private Map<String, RDFTerm> currentResult = null;
private final List<Map<String, RDFTerm>> results = new ArrayList<>();
private boolean readingValue;
private String lang; //the xml:lang attribute of a literal
private String value;
private Map<String, BlankNode> bNodeMap = new HashMap<>();
private static final Iri XSD_STRING = new Iri("http://www.w3.org/2001/XMLSchema#string");
private static final IRI XSD_STRING = new IRI("http://www.w3.org/2001/XMLSchema#string");

private RdfTerm getBNode(String value) {
private RDFTerm getBNode(String value) {
if (!bNodeMap.containsKey(value)) {
bNodeMap.put(value, new BlankNode());
}
return bNodeMap.get(value);
}

private List<Map<String, RdfTerm>> getResults() {
private List<Map<String, RDFTerm>> getResults() {
return results;
}

@@ -175,11 +175,11 @@ public void endElement(String namespaceURI,
} else {
try {
BindingType b = BindingType.valueOf(localName);
RdfTerm rdfTerm = null;
RDFTerm rdfTerm = null;
final Language language = lang == null? null : new Language(lang);;
switch (b) {
case uri:
rdfTerm = new Iri(value);
rdfTerm = new IRI(value);
break;
case bnode:
rdfTerm = getBNode(value);
@@ -194,7 +194,7 @@ public String getLexicalForm() {
}

@Override
public Iri getDataType() {
public IRI getDataType() {
//TODO implement
return XSD_STRING;
}

0 comments on commit e59c1ac

Please sign in to comment.