on assigning
sioc:topic as predicate
to a large drupal voc (6000 terms, flat) default as skos:Concept

* Warning: Illegal offset type in rdf_mapping_load() (line 136 of /var/www/drupal-7.x-dev/modules/rdf/rdf.module).
* Recoverable fatal error: Object of class stdClass could not be converted to string in DatabaseStatementBase->execute() (line 1961 of /var/www/drupal-7.x-dev/includes/database/database.inc).

Comments

groovehunter’s picture

destination page with error is http://drupal7a/admin/structure/taxonomy/verfahren/rdf

Anonymous’s picture

Is drupal7a a domain name?

groovehunter’s picture

yep, it's a local vhost, sorry i thought it would be obvious

Anonymous’s picture

No problem, I assumed it was but sometimes people post a local URL without realizing that because it is local, other people can't access it. You can just post the path from admin/ on and folks will know what you're talking about.

Anonymous’s picture

I believe the problem here is that we are assuming that the entity type is node... RDF UI originated in Drupal 6 as RDF CCK, so I think some of the assumptions carried through.

When I tested it on content types, it worked. When I tested it on a Taxonomy, I got the following two errors:

  • Notice: Undefined property: stdClass::$type in rdfui_admin_rdf_overview_form_submit() (line 266 of /Users/clark/Documents/sites/drupal-head/sites/all/modules/rdf/rdfui.module).
  • PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'bundle' cannot be null: INSERT INTO {rdf_mapping} (mapping, type, bundle) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => a:5:{s:7:"rdftype";a:1:{i:0;s:8:"skos:Con";}s:4:"name";a:1:{s:10:"predicates";a:2:{i:0;s:10:"rdfs:label";i:1;s:14:"skos:prefLabel";}}s:11:"description";a:1:{s:10:"predicates";a:1:{i:0;s:15:"skos:definition";}}s:3:"vid";a:2:{s:10:"predicates";a:1:{i:0;s:13:"skos:inScheme";}s:4:"type";s:3:"rel";}s:6:"parent";a:2:{s:10:"predicates";a:1:{i:0;s:12:"skos:broader";}s:4:"type";s:3:"rel";}} [:db_insert_placeholder_1] => taxonomy_term [:db_insert_placeholder_2] => ) in rdf_mapping_save() (line 239 of /Users/clark/Documents/sites/drupal-head/modules/rdf/rdf.module).

I haven't looked through to see where in the code this would be.

Anonymous’s picture

Title: Illegal offset type in rdf_mapping_load() on assigning sioc:topic as predicate to a voc » RDF UI doesn't work when mapping Taxonomy

Changing title to reflect.

Anonymous’s picture

Also, to do what you want, groovehunter, you shouldn't need to change the mappings on the taxonomy.

sioc:topic is a property that links the term on the node to the node itself. You would want this mapping to be on the taxonomy field on the node, not on the vocabulary. skos:Concept is a class, which means that it is a type of thing. sioc:topic is a predicate, which means that it is a relationship between two things.

So you should be able to achieve what you want with the module as it is right now. We (the maintainers) should still look into this issue, though.

steinmb’s picture

Hi
We also stumbled upon this bug while testing out RDF on a vocal. Lin made a point in #7 so it might not be an such a good idea but we are as many other is trying to wrap our heads around how to utilize this D7 RDF awesomeness.

AlanAtLarge’s picture

Following

Anonymous’s picture

thanks for topping this issue, I've been working on a project for a while, but that is winding down. I think I'll have time to look at this stuff in the next few days

scor’s picture

Project: Resource Description Framework (RDF) » RDF Extensions

Marked #1156842: RDF UI assumes nodes? as duplicate.

ronald_istos’s picture

Priority: Normal » Major
Status: Active » Needs review
StatusFileSize
new3.77 KB

Here is a patch to fix the taxonomy vocabulary mapping issue - not sure is the right approach but should at least highlight the pain points and someone more knowledgeable on the module could fix it properly faster.

scor’s picture

@@ -123,8 +123,8 @@ function rdfui_admin_rdf_overview_form($form, &$form_state, $entity_type, $bundl
+  // Don't make assumptions about entities and only get the type if dealing with a node entity
+  $type = ($entity_type == 'node') ? node_type_get_type($bundle) : '';

any entity type can have multiple bundles, so this comment is unclear. It feels strange to ignore bundle if the type is not a node, but since RDF UI only support multiple bundles for node at the moment, it might make sense to have such a hack.

Having a generic UI would be best to avoid such hack: #1159104: Create a more generic RDF UI mapping tool, but I would not be opposed to solving the taxonomy issue until we have such generic RDF UI.

Anonymous’s picture

This patch also fixes notices with field collection entity types.

Anonymous’s picture

Status: Needs review » Needs work

We also need to add $field_name != 'title' to the conditional at line 544.

  if (isset($form_state['input']['rdf_title_type']) || $field_name != 'title') {
Anonymous’s picture

Status: Needs work » Fixed

Ok, I committed the patch from Ronald with the minor change that I mentioned.

steinmb’s picture

Thanx Lin :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

smithdalec’s picture

Priority: Major » Minor
Status: Closed (fixed) » Active
StatusFileSize
new1.57 KB

My apologies for opening this back up :)
This error still occurs when using an entity type (other than taxonomy term) where the bundle key is something other than "type". For instance, the Taxonomy Term entity type uses "machine_name" as its bundle key (this can be anything as specified in hook_entity_info()).
I've created a patch that fixes this issue: