<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE rdf:RDF [
 <!ENTITY mebase 'http://rdf.myexperiment.org/ontologies/base/'>
 <!ENTITY meac 'http://rdf.myexperiment.org/ontologies/attrib_credit/'>
 <!ENTITY meannot 'http://rdf.myexperiment.org/ontologies/annotations/'>
 <!ENTITY mepack 'http://rdf.myexperiment.org/ontologies/packs/'>
 <!ENTITY meexp 'http://rdf.myexperiment.org/ontologies/experiments/'>
 <!ENTITY mecontrib 'http://rdf.myexperiment.org/ontologies/contributions/'>
 <!ENTITY mevd 'http://rdf.myexperiment.org/ontologies/viewings_downloads/'>
 <!ENTITY mespec 'http://rdf.myexperiment.org/ontologies/specific/'>
 <!ENTITY rdf  'http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
 <!ENTITY dc  'http://purl.org/dc/elements/1.1/'>
 <!ENTITY dcterms  'http://purl.org/dc/terms/'>
 <!ENTITY cc  'http://web.resource.org/cc/'>
 <!ENTITY foaf  'http://purl.org/dc/terms/'>
 <!ENTITY sioc  'http://rdfs.org/sioc/ns#'>
 <!ENTITY snarm 'http://rdf.myexperiment.org/snarm#'>
 <!ENTITY xsd 'http://www.w3.org/2001/XMLSchema#'>

]>

<rdf:RDF xmlns:mebase   ="&mebase;"
         xmlns:meac     ="&meac;"
         xmlns:meannot  ="&meannot;"
         xmlns:mepack   ="&mepack;"
         xmlns:meexp    ="&meexp;"
         xmlns:mecontrib="&mecontrib;"
         xmlns:mevd     ="&mevd;"
         xmlns:mespec   ="&mespec;"
         xmlns:rdf      ="&rdf;"
         xmlns:dc       ="&dc;"
         xmlns:dcterms  ="&dcterms;"
         xmlns:cc       ="&cc;"
         xmlns:foaf     ="&foaf;"
         xmlns:sioc     ="&sioc;"
         xmlns:snarm    ="&snarm;"
         xmlns:xsd      ="&xsd;"
>
  <mecomp:BeanshellProcessor rdf:about="http://rdf.myexperiment.org/example/BeanshellProcessor">
    <dcterms:title rdf:datatype="&xsd;string">remove_xml</dcterms:title>
    <mecomp:processor-type rdf:datatype="&xsd;string">beanshell</mecomp:processor-type>
    <mecomp:processor-script rdf:datatype="&xsd;string">import java.util.regex.*;

String pStr = &quot;&lt;(.*?)&gt;(.*)&quot;;
Pattern idPattern = Pattern.compile(pStr, Pattern.UNIX_LINES | Pattern.DOTALL);
Matcher idMatcher = idPattern.matcher(in.replaceAll(&quot;\n&quot;,&quot; &quot;));
boolean matched = idMatcher.matches();

if (matched) {
out = idMatcher.group(2);
}
else {
print(&quot;didn&apos;t match id&quot;);
Failure = true;
FailureMessage = &quot;Couldn&apos;t extract from &quot; + in;
}</mecomp:processor-script>
    <mecomp:belongs-to-workflow rdf:resource="http://rdf.myexperiment.org/WorkflowVersion/1010"/>
  </mecomp:BeanshellProcessor>
</rdf:RDF>
