Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 90A08200BFA for ; Thu, 12 Jan 2017 18:19:39 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 8F25B160B40; Thu, 12 Jan 2017 17:19:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D94FE160B29 for ; Thu, 12 Jan 2017 18:19:38 +0100 (CET) Received: (qmail 66168 invoked by uid 500); 12 Jan 2017 17:19:37 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 66155 invoked by uid 99); 12 Jan 2017 17:19:37 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jan 2017 17:19:37 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 6D037DFA22; Thu, 12 Jan 2017 17:19:37 +0000 (UTC) From: stain To: dev@commons.apache.org Reply-To: dev@commons.apache.org References: In-Reply-To: Subject: [GitHub] commons-rdf pull request #27: COMMONSRDF-47 RDFSyntax as an interface Content-Type: text/plain Message-Id: <20170112171937.6D037DFA22@git1-us-west.apache.org> Date: Thu, 12 Jan 2017 17:19:37 +0000 (UTC) archived-at: Thu, 12 Jan 2017 17:19:39 -0000 Github user stain commented on a diff in the pull request: https://github.com/apache/commons-rdf/pull/27#discussion_r95840484 --- Diff: api/src/main/java/org/apache/commons/rdf/api/RDFSyntax.java --- @@ -22,6 +22,124 @@ import java.util.Optional; /** + * An RDF syntax, e.g. as used for parsing and writing RDF. + *

+ * An RDF syntax is uniquely identified by its {@link #mediaType()}, and has a + * suggested {@link #fileExtension()}. + *

+ * Some of the RDF syntaxes may {@link #supportsDataset()}, meaning they can + * represent {@link Quad}s. + *

+ * An enumeration of the official RDF 1.1 syntaxes is available in + * {@link OfficialRDFSyntax} - for convenience they are also accessible + * as constants here, e.g. RDFSyntax.JSONLD. + * + */ +public interface RDFSyntax { + + public static OfficialRDFSyntax JSONLD = OfficialRDFSyntax.JSONLD; + public static OfficialRDFSyntax TURTLE = OfficialRDFSyntax.TURTLE; + public static OfficialRDFSyntax NQUADS = OfficialRDFSyntax.NQUADS; + public static OfficialRDFSyntax NTRIPLES = OfficialRDFSyntax.NTRIPLES; + public static OfficialRDFSyntax RDFA_HTML = OfficialRDFSyntax.RDFA_HTML; + public static OfficialRDFSyntax RDFA_XHTML = OfficialRDFSyntax.RDFA_XHTML; + public static OfficialRDFSyntax RDFXML = OfficialRDFSyntax.RDFXML; + public static OfficialRDFSyntax TRIG = OfficialRDFSyntax.TRIG; + + /** + * A short name of the RDF Syntax. + *

+ * The name typically corresponds to the {@link Enum#name()} of for + * {@link OfficialRDFSyntax}, e.g. JSONLD. + * + * @return Short name for RDF syntax + */ + public String name(); + + /** + * The title of the RDF Syntax. + *

+ * This is generally the title of the corresponding standard, + * e.g. RDF 1.1 Turtle. + * + * @return Title of RDF Syntax + */ + public String title(); + + /** + * The IANA media type for + * the RDF syntax. + *

+ * The media type can be used as part of Content-Type and + * Accept for content negotiation in the + * HTTP + * protocol. + */ + public String mediaType(); + + /** + * The IANA-registered + * file extension. + *

+ * The file extension includes the leading period, e.g. .jsonld + */ + public String fileExtension(); + + /** + * Indicate if this RDF syntax supports + * RDF + * Datasets. + */ + public boolean supportsDataset(); + + --- End diff -- I think that is out of scope for now, as Commons RDF does not specify namespace preservation yet anywhere else. Let's revisit that when we make `RDFWriter` where it might be a bit more natural than in `RDFParser` (although I know RDF4J can preserve parsed namespaces) --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org For additional commands, e-mail: dev-help@commons.apache.org