[ 
https://issues.apache.org/jira/browse/COMMONSRDF-46?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15613406#comment-15613406
 ] 

ASF GitHub Bot commented on COMMONSRDF-46:
------------------------------------------

Github user ansell commented on a diff in the pull request:

    https://github.com/apache/incubator-commonsrdf/pull/25#discussion_r85235198
  
    --- Diff: simple/src/main/java/org/apache/commons/rdf/simple/SimpleRDF.java 
---
    @@ -0,0 +1,114 @@
    +/**
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements. See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership. The ASF licenses this file
    + * to you under the Apache License, Version 2.0 (the
    + * "License"); you may not use this file except in compliance
    + * with the License.  You may obtain a copy of the License at
    + *
    + *     http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +package org.apache.commons.rdf.simple;
    +
    +import java.util.UUID;
    +
    +import org.apache.commons.rdf.api.BlankNode;
    +import org.apache.commons.rdf.api.BlankNodeOrIRI;
    +import org.apache.commons.rdf.api.Dataset;
    +import org.apache.commons.rdf.api.Graph;
    +import org.apache.commons.rdf.api.IRI;
    +import org.apache.commons.rdf.api.Literal;
    +import org.apache.commons.rdf.api.Quad;
    +import org.apache.commons.rdf.api.RDFTerm;
    +import org.apache.commons.rdf.api.RDF;
    +import org.apache.commons.rdf.api.Triple;
    +
    +/**
    + * Simple RDF implementation.
    + * <p>
    + * The {@link RDFTerm}, {@link Triple}, {@link Quad}, {@link Graph}
    + * and {@link Dataset} instances created by SimpleRDF are
    + * simple in-memory Implementations that are not thread-safe or efficient, 
but
    + * which may be useful for testing and prototyping purposes.
    + */
    +public class SimpleRDF implements RDF {
    +
    +   /**
    +    * Marker interface to say that this RDFTerm is part of the 
    +    * Simple implementation. Used by {@link GraphImpl} to avoid
    +    * double remapping. 
    +    * <p>
    +    * This method is package protected to avoid any third-party
    +    * subclasses.
    +    *
    +    */
    --- End diff --
    
    Inconsistent indentation.


> Rename RDFTermFactory to RDF
> ----------------------------
>
>                 Key: COMMONSRDF-46
>                 URL: https://issues.apache.org/jira/browse/COMMONSRDF-46
>             Project: Apache Commons RDF
>          Issue Type: Bug
>          Components: api
>            Reporter: Stian Soiland-Reyes
>            Assignee: Stian Soiland-Reyes
>             Fix For: 0.3.0
>
>
> As [mentioned on 
> dev@commons|https://lists.apache.org/thread.html/ff9f0eda82a70fea38bd46781a062d182cd7792aee57a4563f854b27@%3Cdev.commonsrdf.apache.org%3E],
>  the {{RDFTermFactory}} will grow in 0.3.0 to include {{Dataset}} and 
> {{Quad}} creation, which are not {{RDFTerm}} instances.
> As well, the new implementations of RDFTermFactory for Jena and RDF4J also 
> include converter methods from/to their underlying types - which feel 
> somewhat wrong in a "factory" as they may are free to wrap/unwrap rather than 
> make new instances. 
> So the suggestion is a radical style change - rename {{RDFTermFactory}} to 
> {{RDF}}, and its children to {{SimpleRDF}} {{JenaRDF}}, {{RDF4J}}, 
> {{JsonLDRDF}}.
> Typical usage then looks pretty neat:
> {code}
> RDF rdf = new JenaRDF(); 
> IRI iri = rdf.createIRI("http://example.com/";); 
> Triple triple = rdf.createTriple(iri, iri, iri); 
> Graph graph = rdf.createGraph(); 
> graph.add(triple);
> {code}
> but works less well as a static constant {{RDF}}:
> {code}
> private static final RDF RDF = new JenaRDF();
> {code}
> (before {{FACTORY}} might have made sense)
> Some style considerations:  
> * {{RDF4JRDF}} looks weird, so just {{RDF4J}} there
> * {{SimpleRDF}} looks good (as Simple does not exists outside Commons RDF)
> * Jena already have 
> [org.apache.jena](https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/Jena.html),
>  so {{JenaRDF}} is better than another {{Jena}}
> * {{JsonLdRDF}} 
> * Documentation about just {{RDF}} the interface can be confusing against 
> _RDF_ the concept, requiring using {{<code>}}-style typography and expanded 
> phrases like "an {{RDF}} implementation" instead of "an {{RDF}}"
> A milder variant is: {{RDFFactory}} with children {{SimpleRDFFactory}}, 
> {{JenaFactory}}, {{RDF4JFactory}}. {{JsonLDFactory}} -- here we can skip 
> {{RDF}} from the children except from the newbie {{Simple}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to