<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Ruby Semantic Web Pipes Semantic Web Pipes just got easier</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Daniel</forename><surname>Hahn</surname></persName>
							<affiliation key="aff0">
								<orgName type="institution">NET7 Internet Open Solutions</orgName>
								<address>
									<settlement>Pisa</settlement>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Michele</forename><surname>Barbera</surname></persName>
							<affiliation key="aff0">
								<orgName type="institution">NET7 Internet Open Solutions</orgName>
								<address>
									<settlement>Pisa</settlement>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">Ruby Semantic Web Pipes Semantic Web Pipes just got easier</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">7E2D84293388D7FE6968C82D37E88A46</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-24T22:52+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<abstract/>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>Ruby SemPipes are based on the Semantic Web Pipes proposed by Giovanni Tummarello, Christian Morbidoni et. al. <ref type="bibr" target="#b0">[1]</ref>. Semantic web pipes provide a mechanism similar to Yahoo! Pipes<ref type="foot" target="#foot_0">1</ref> , but work on semantic web data. They allow users to filter and recombine semantic web data on the fly (more information can be found in the cited work). The original Semantic Pipes also have some advanced features that are not touched here, such as the revocation of triples.</p><p>Ruby SemPipes<ref type="foot" target="#foot_1">2</ref> . are an intentionally simple reimplementation of the Semantic Web Pipes. They provide an easy "pipe description language" . Pipes can easily be created and modified from a script or application, the definitions are painless to read and they don't require the pipe developer to manually edit XML files or SPARQL queries.</p><p>To make things simple, Ruby SemPipes treat all RDF graphs as enumerations of triples. A pipe itself is also an enumeration over it's result set and any enumeration of triples (including other pipes) can be used as an input for a pipe.</p><p>Using Eyal Oren's ActiveRDF <ref type="bibr" target="#b1">[2]</ref> library, it will be quite easy to provide input adapters that connect to "real" RDF endpoints and perform SPARQL queries. These adapters could then be used as input to a pipe. Conversely, output adapters could re-write the result of a pipe to a common storage format, such as RDF/XML.</p><p>The first implementation of Ruby SemPipes contains a merge, filter and rewrite operator; a smushing operator is in the pipeline. The filter and rewrite operators allow a simple but powerful filtering (or rewriting) of triples using regular expression. In addition to the operators, pipes may also contain actions which allow the developer to manipulate triples programmatically. All built-in operators are themselves pipes written in the same way as user-created pipes.</p><p>Each pipe takes on ore more sets of RDF triples as an input; the pipe itself will operate on the union (including duplicates) of the input sets -the merge operator will actually just remove duplicates from the input. # R e w r i t e Tim Berners−Lee e n t r i e s r e w r i t t e n _ t r i p l e s = r e w r i t e ( m e r g e d _ t r i p l e s ) do r e w r i t e : a l l , "&lt;h t t p : \ / \ / dbpedia . o r g \/ r e s o u r c e \/ Tim_Berners−Lee&gt;" , "&lt;h t t p : / /www. w3 . o r g / P e o p l e / Berners −Lee / c a r d#i &gt;" end # Remove a l l t r i p l e s d e a l i n g w i t h A l i c e s e l f . output = f i l t e r ( r e w r i t t e n _ t r i p l e s ) do r e j e c t : a l l "&lt;h t t p : \ / \ / s t r a n g e w o r l d . com\\/ A l i c e " end end # D e f i n e a n o t h e r p i p e d e f i n e _ p i p e : another_pipe do temp = new_pipe ( i n p u t ) s e l f . output = a c t i o n ( temp ) do | i n p u t | i n p u t . to_a &lt;&lt; [ @subject , @ p r e d i c a t e , @o b je ct ] end end # Use t h e p i p e AnotherPipe . new ( load_some_input ) . each { | t r i p l e | p u t s t r i p l e } end Listing 1.1 shows a sample setup of two Ruby SemPipes. The first pipe merges all input sets, then rewrites Tim Berners-Lee's dbpedia URL with his own URL and finally filters out all entries dealing with Alice. Pipes can be easily connected using variables; the special variable input is used in the pipe description to denote the pipe's input. The self.output variable is used to assign a value to the current pipe's result set.</p><p>The second pipe shows that other pipes can be used just as easily as the built-in operators. The pipe also contains a generic action that adds a (complete random) triple to the graph.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Listing 1 . 1 .</head><label>11</label><figDesc>Sample Pipe setup module SemPipe # The f i r s t p i p e d e f i n e _ p i p e : new_pipe do m e r g e d _ t r i p l e s = merge ( i n p u t )</figDesc></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="1" xml:id="foot_0">http://pipes.yahoo.com/</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="2" xml:id="foot_1">The first experimental version is available via public svn from http://svn.talia. discovery-project.eu/talia-intern/playground/ruby_pipes/trunk</note>
		</body>
		<back>

			<div type="acknowledgement">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Acknowledgements</head><p>This work has been supported by Discovery, an ECP 2005 CULT 038206 project under the EC eContentplus programme. Of course we also like to acknowledge the original work of Christian and Giovanni.</p></div>
			</div>

			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<monogr>
		<title level="m" type="main">Semantic web pipes</title>
		<author>
			<persName><forename type="first">C</forename><surname>Morbidoni</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Polleres</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><forename type="middle">L</forename><surname>Phuoc</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Tummarello</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2007">2007</date>
		</imprint>
		<respStmt>
			<orgName>DERI</orgName>
		</respStmt>
	</monogr>
	<note type="report_type">Technical report</note>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">ActiveRDF: Object-Oriented Semantic Web Programming</title>
		<author>
			<persName><forename type="first">E</forename><surname>Oren</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Debru</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Gerke</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Haller</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Decker</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">16th International World Wide Web Conference (WWW2007)</title>
				<meeting><address><addrLine>Banff, Alberta, Canada</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2007-05-12">8-12 May, 2007</date>
			<biblScope unit="page" from="817" to="823" />
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
