-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a33ba9
commit be88783
Showing
8 changed files
with
116 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# encoding: utf-8 | ||
# Copyright 2023 California Institute of Technology. ALL RIGHTS | ||
# RESERVED. U.S. Government Sponsorship acknowledged. | ||
|
||
|
||
from .predicatehandler import ISimplePredicateHandler | ||
from Acquisition import aq_inner | ||
import rdflib | ||
|
||
|
||
class IMultiPipePredicateHandler(ISimplePredicateHandler): | ||
'''A handler for DMCC web services that maps tokenized |-separated keys to multiple literal RDF values.''' | ||
# No further fields are necessary. | ||
|
||
|
||
class MultiPipeAsserter(object): | ||
'''Describes subjects using predicates with multiple literal complementary objects separated by |.''' | ||
def __init__(self, context): | ||
self.context = context | ||
def characterize(self, obj): | ||
context = aq_inner(self.context) | ||
rc = [(rdflib.URIRef(context.predicateURI), rdflib.Literal(i.strip())) for i in obj.split('|')] | ||
return rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/edrn.rdf/edrn/rdf/profiles/default/types/edrn.rdf.multipipepredicatehandler.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<!-- | ||
Copyright 2012 California Institute of Technology. ALL RIGHTS | ||
RESERVED. U.S. Government Sponsorship acknowledged. | ||
--> | ||
<object name='edrn.rdf.multipipepredicatehandler' meta_type='Dexterity FTI' i18n:domain='edrn.rdf' | ||
xmlns:i18n='http://xml.zope.org/namespaces/i18n'> | ||
<property name='title' i18n:translate=''>Multi-Pipe Predicate Handler</property> | ||
<property name='description' i18n:translate=''>A handler for DMCC web services that maps tokenized |-separated keys to multiple literal RDF values.</property> | ||
<property name='allow_discussion'>False</property> | ||
<property name='global_allow'>False</property> | ||
<property name='filter_content_types'>True</property> | ||
<property name='allowed_content_types' /> | ||
<property name='schema'>edrn.rdf.multipipepredicatehandler.IMultiPipePredicateHandler</property> | ||
<property name='klass'>plone.dexterity.content.Item</property> | ||
<property name='add_permission'>cmf.AddPortalContent</property> | ||
<property name='behaviors'> | ||
<element value='plone.app.content.interfaces.INameFromTitle' /> | ||
</property> | ||
<property name='default_view'>view</property> | ||
<property name='default_view_fallback'>False</property> | ||
<property name='view_methods'> | ||
<element value='view' /> | ||
</property> | ||
<alias from='(Default)' to='(dynamic view)' /> | ||
<alias from='edit' to='@@edit' /> | ||
<alias from='sharing' to='@@sharing' /> | ||
<alias from='view' to='(selected layout)' /> | ||
<action title='View' action_id='view' category='object' condition_expr='' url_expr='string:${object_url}' visible='True'> | ||
<permission value='View' /> | ||
</action> | ||
<action title='Edit' action_id='edit' category='object' condition_expr='' url_expr='string:${object_url}/edit' visible='True'> | ||
<permission value='Modify portal content' /> | ||
</action> | ||
</object> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters