Uploaded image for project: 'Apache Commons RDF'
  1. Apache Commons RDF
  2. COMMONSRDF-46

Rename RDFTermFactory to RDF

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.3.0
    • api
    • None

    Description

      As mentioned on dev@commons, 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:

      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);
      

      but works less well as a static constant RDF:

      private static final RDF RDF = new JenaRDF();
      

      (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.

      Attachments

        Issue Links

          Activity

            People

              stain Stian Soiland-Reyes
              stain Stian Soiland-Reyes
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: