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 067DB200BC2 for ; Thu, 17 Nov 2016 23:56:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 04EC7160B0B; Thu, 17 Nov 2016 22:56:06 +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 50C33160AD8 for ; Thu, 17 Nov 2016 23:56:05 +0100 (CET) Received: (qmail 9926 invoked by uid 500); 17 Nov 2016 22:56:04 -0000 Mailing-List: contact dev-help@commonsrdf.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commonsrdf.incubator.apache.org Delivered-To: mailing list dev@commonsrdf.incubator.apache.org Received: (qmail 9911 invoked by uid 99); 17 Nov 2016 22:56:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Nov 2016 22:56:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 18CA6C13EE for ; Thu, 17 Nov 2016 22:56:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -7.018 X-Spam-Level: X-Spam-Status: No, score=-7.018 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id v1qioZ22IeGo for ; Thu, 17 Nov 2016 22:56:03 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id C56A35FC72 for ; Thu, 17 Nov 2016 22:55:59 +0000 (UTC) Received: (qmail 8257 invoked by uid 99); 17 Nov 2016 22:55:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Nov 2016 22:55:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id BCE5E2C4C75 for ; Thu, 17 Nov 2016 22:55:58 +0000 (UTC) Date: Thu, 17 Nov 2016 22:55:58 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@commonsrdf.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (COMMONSRDF-47) RDFSyntax should be interface, not enum MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 17 Nov 2016 22:56:06 -0000 [ https://issues.apache.org/jira/browse/COMMONSRDF-47?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15675059#comment-15675059 ] ASF GitHub Bot commented on COMMONSRDF-47: ------------------------------------------ Github user ansell commented on a diff in the pull request: https://github.com/apache/incubator-commonsrdf/pull/27#discussion_r88350685 --- 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(); --- End diff -- Do you plan on supporting alternative media types here, to either support old media types or other commonly used media types? > RDFSyntax should be interface, not enum > --------------------------------------- > > Key: COMMONSRDF-47 > URL: https://issues.apache.org/jira/browse/COMMONSRDF-47 > Project: Apache Commons RDF > Issue Type: Bug > Components: api > Affects Versions: 0.2.0 > Reporter: Stian Soiland-Reyes > Assignee: Stian Soiland-Reyes > > [~p_ansell] raises in [pull request 25|https://github.com/apache/incubator-commonsrdf/pull/25#discussion_r85231845] > {quote} > Using enum for RDFSyntax is a bad idea unless it overrides an interface and the interface is used in method signatures instead of the enum. There are many other RDFSyntaxes, and enum (without implementing an interface) is only suited to cases where the full set are known a priori. > {quote} -- This message was sent by Atlassian JIRA (v6.3.4#6332)