Problem/Motivation

As discussed in a comment in another issue, the maintainers agreed last spring that Evoc should be deprecated. I believe this discussion took place as part of this Linked Data Sprint.

People do not understand why they should use the module, it causes conflicts with other things, and doesn't work for the target use case much of the time. It has a highly normalized database structure, which makes for a lot of unnecessary tables in the database. It was committed to the project without proper review, so it doesn't have key things such as uninstall functions.

Maintainers themselves have circumnavigated using the functionality; for example, by creating modules that add user interfaces for individual vocabularies (eg Schema.org).

Proposed resolution

This should be handled in two phases.

Deprecate

Formally post notice of deprecation and provide proper uninstall functions.

Remove

Remove code from both the evoc module and the code that handles vocabulary management in RDFx. Add uninstall functionality from deprecation phase to an update to RDFx.

Comments

scor’s picture

Issue tags: +RDF, +sprint

yes, we never ended up cleaning that up... +1

Anonymous’s picture

What do you think of this plan:

  1. I will draft a deprecation notice, you can review before sprint
  2. During the sprint, I will code the uninstall functions, which will be tested as part of the sprint
  3. After you post results of the sprint, I will post the deprecation notice
  4. Roll another release
  5. After three weeks deprecation, remove the code
  6. Roll another release
scor’s picture

plan sounds good. Maybe we could allow a few more weeks buffer time, like 6 weeks? or we could also ask anyone who needs more than 3 weeks to just say so... either way, +1!

Anonymous’s picture

I think it should be ok since we will have a point release which people can use until they are ready to change, but if we get pushback when we announce the deprecation, we can figure out whether an extension would help with anything.

Anonymous’s picture

What do you think of this?

Part of what it takes to build a good module is sometimes taking away bits of code that aren’t part of the module’s main functionality. In this spirit, the maintainers of RDFx have decided to remove Evoc, the External Vocabulary Importer module, and related code from the RDFx package. This does not affect Drupal core's storage or handling of RDF mappings.

The Evoc module allows users to download external vocabularies, such as FOAF, so that terms from the vocabulary can be auto-completed in the RDF User Interface. However, because users often don’t know where to find vocabularies, the module is underutilized. In addition, when users do find vocabularies, they may not know the right URL to use and, even if they do, many external vocabularies are published in idiosyncratic ways, which Evoc cannot process. This leads to unpredictable results.

The module is now deprecated. A point release has been created, which provides Evoc in its current state. The module will be fully removed from the RDFx package in 3 weeks.

If you want to contribute:

When development began on porting the vocabulary editing tool Neologism to Drupal 7, there were plans to keep Evoc-like functionality in that module. Those who would like to work on this functionality should consider contributing there. There has also been some discussion of replacing this functionality in RDFx with a more service-based approach, such as the one taken in Microdata module.

scor’s picture

Looks good. you might also want to mention that the removal of evoc will only affect the autocomplete of RDF UI, but people will still be able to add namespaces manually and set their mappings as long as they know what terms they want to use.

Related issue re future of RDF UI: #1130598: Make the RDF UI autocomplete more extensible.

scor’s picture

Please also point to the service based approach wiki on gdo: Architecture of the centralized vocabulary republishing service

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new25.88 KB

Ok, I think I got all of it, but I need a break and haven't checked for sure yet.

In the patch I move the autocomplete functions to RDFx. However, these will move to RDFui with Kelly's patch. We will also need to do a clean up at some point to see which admin screens should be in RDFui instead of RDFx.

scor’s picture

Status: Needs review » Needs work

Thanks Lin for working on this. Uninstalling evoc works, and namespaces which were imported in evoc are preserved during the uninstallation.

+++ b/rdfx.install
@@ -71,9 +71,6 @@ function rdfx_schema() {
-    'unique keys' => array(
-      'gid_uri' => array('gid', 'uri'),
-    ),

any reason for removing this key? I guess we would need an update function as well. but don't we want to keep this unique key anyways?

+++ b/rdfx.module
@@ -391,3 +390,36 @@ function rdfx_features_api() {
+function rdfx_rdf_namespaces() {
+  // Starts with some additionnal common namespaces which core does not include.
+  $ns_mappings = array(
+    'owl'      => 'http://www.w3.org/2002/07/owl#',
+    'rdf'      => 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
+    'rss'      => 'http://purl.org/rss/1.0/',
+    // url() does not support empty fragment.
+    'site'     => url('ns', array('absolute' => TRUE)) . '#',
+  );
+
+  // Gets the custom namespaces stored in the database.
+  $query = db_select('rdfx_namespaces', 'n');
+  $query->fields('n', array('prefix', 'uri'));
+  $query->orderBy('n.prefix');
+  $namespaces = $query->execute()->fetchAllKeyed();
+  foreach ($namespaces as $prefix => $uri) {
+    $ns_mappings[$prefix] = $uri;
+  }
+
+  return $ns_mappings;
+}

This function assumes evoc has been uninstalled. If people apply this patch (or upgrade rdfx after this patch has been committed), and don't uninstall evoc, their namespaces will be messed up because it will include all the namespaces of the imported vocabularies, with conflicts etc. I think that until evoc is completely removed, we need to check in this function whether evoc is still enabled (if the rdfx_vocabulary_graphs table exists) and keep the old query if it's the case. This is the old code which joins with the evoc table

  $query = db_select('rdfx_vocabulary_graphs', 'g');
  $query->fields('n', array('prefix', 'uri'));
  $query->join('rdfx_namespaces', 'n', 'g.main_ns = n.nsid');
+++ b/rdfx.module
index 1bbc60f..0000000
--- a/rdfx.terms.inc
+++ /dev/null

maybe I'm confused, but I thought in the first patch/phase, we would provide the uninstall function for evoc, while leaving the evoc functionality in the module.

I thought this was the plan - let me know if I'm missing something:
7.x-2.0-alpha5 (next release): this is the last release of RDFx to include evoc. it also comes with uninstall function to cleanly remove evoc, if you don't use or need evoc, you might want to uninstall it.
7.x-2.0-alpha6: this release no longer includes evoc functionality. rdfx.install includes update function to force people to uninstall evoc if they haven't done so already. that's when the evoc code is being remove.

Anonymous’s picture

any reason for removing this key?

The graph ID is no longer a meaningful value. There's no reason to enforce the URI constraint, since you can have two prefixes that point to the same URI.

Good point about assuming that Evoc has been uninstalled... I think I got distracted during the sprint started just removing it totally.

Anonymous’s picture

Status: Needs work » Needs review
StatusFileSize
new4.52 KB

I made the change to rdfx_rdf_namespaces and reinstated the terms file. I think that's everything that needed to change to make this deprecation instead of removal.

I have to run and will be on deadline over the weekend and early next week, but if this works feel free to commit.

scor’s picture

Status: Needs review » Needs work

I just tried this patch and it doesn't work because _rdfx_extract_schema() is undefined. If you try to reinclude rdfx.terms.inc, then rdfx_rdf_namespaces() is defined twice. If you remove the old rdfx_rdf_namespaces(), then you still need to take care of returning empty autocomplete results when evoc is disabled... I feel like we're wasting too much time trying to fix some code that's going to be discarded in a few weeks. Lin, if you agree, let's just call 7.x-2.0-alpha4 the latest version including evoc, and let's commit something close to your first patch that will remove evoc and force people to uninstall its tables when they upgrade to alpha5. We're only in alpha anyways, so I don't think anyone will mind if we deprecate this functionality. I'd much rather spend time on more promising patches which will improve the module...

new suggested plan:
- post deprecation notice (#5 + #6)
- commit patch for evoc removal (most of the code is ready, uninstall function works well)
- roll a new release

Anonymous’s picture

Sounds good to me, I'll post the deprecation notice tomorrow.