aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2019-12-01 14:58:07 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2019-12-01 15:06:01 -0800
commita4ebb33cd5f61ae30b4925a89119f20d2ed02408 (patch)
tree6107b141cd098482323ab1bfb18bcfb445a8dc48
parent64fa1aa8cf7d2b726842dcb7d2dd62919a0b7bd4 (diff)
Trim spaces for RDF entry links
-rw-r--r--reader/rdf/parser_test.go64
-rw-r--r--reader/rdf/rdf.go2
2 files changed, 65 insertions, 1 deletions
diff --git a/reader/rdf/parser_test.go b/reader/rdf/parser_test.go
index 4f3d033..87410f8 100644
--- a/reader/rdf/parser_test.go
+++ b/reader/rdf/parser_test.go
@@ -422,3 +422,67 @@ func TestParseFeedWithInvalidCharacterEntity(t *testing.T) {
t.Errorf(`Incorrect URL, got: %q`, feed.SiteURL)
}
}
+
+func TestParseFeedWithURLWrappedInSpaces(t *testing.T) {
+ data := `<?xml version="1.0" encoding="utf-8"?>
+ <rdf:RDF xmlns:admin="http://webns.net/mvcb/" xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:prism="http://purl.org/rss/1.0/modules/prism/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/">
+ <channel rdf:about="http://biorxiv.org">
+ <title>bioRxiv Subject Collection: Bioengineering</title>
+ <link>http://biorxiv.org</link>
+ <description>
+ This feed contains articles for bioRxiv Subject Collection "Bioengineering"
+ </description>
+ <items>
+ <rdf:Seq>
+ <rdf:li rdf:resource="http://biorxiv.org/cgi/content/short/857789v1?rss=1"/>
+ </rdf:Seq>
+ </items>
+ <prism:eIssn/>
+ <prism:publicationName>bioRxiv</prism:publicationName>
+ <prism:issn/>
+ <image rdf:resource=""/>
+ </channel>
+ <image rdf:about="">
+ <title>bioRxiv</title>
+ <url/>
+ <link>http://biorxiv.org</link>
+ </image>
+ <item rdf:about="http://biorxiv.org/cgi/content/short/857789v1?rss=1">
+ <title>
+ <![CDATA[
+ Microscale Collagen and Fibroblast Interactions Enhance Primary Human Hepatocyte Functions in 3-Dimensional Models
+ ]]>
+ </title>
+ <link>
+ http://biorxiv.org/cgi/content/short/857789v1?rss=1
+ </link>
+ <description><![CDATA[
+ Human liver models that are 3-dimensional (3D) in architecture are proving to be indispensable for diverse applications, including compound metabolism and toxicity screening during preclinical drug development, to model human liver diseases for the discovery of novel therapeutics, and for cell-based therapies in the clinic; however, further development of such models is needed to maintain high levels of primary human hepatocyte (PHH) functions for weeks to months in vitro. Therefore, here we determined how microscale 3D collagen-I presentation and fibroblast interaction could affect the long-term functions of PHHs. High-throughput droplet microfluidics was utilized to rapidly generate reproducibly-sized (~300 micron diameter) microtissues containing PHHs encapsulated in collagen-I +/- supportive fibroblasts, namely 3T3-J2 murine embryonic fibroblasts or primary human hepatic stellate cells (HSCs); self-assembled spheroids and bulk collagen gels (macrogels) containing PHHs served as gold-standard controls. Hepatic functions (e.g. albumin and cytochrome-P450 or CYP activities) and gene expression were subsequently measured for up to 6 weeks. We found that collagen-based 3D microtissues rescued PHH functions within static multi-well plates at 2- to 30-fold higher levels than self-assembled spheroids or macrogels. Further coating of PHH microtissues with 3T3-J2s led to higher hepatic functions than when the two cell types were either coencapsulated together or when HSCs were used for the coating instead. Additionally, the 3T3-J2-coated PHH microtissues displayed 6+ weeks of relatively stable hepatic gene expression and function at levels similar to freshly thawed PHHs. Lastly, microtissues responded in a clinically-relevant manner to drug-mediated CYP induction or hepatotoxicity. In conclusion, fibroblast-coated collagen microtissues containing PHHs display hepatic functions for 6+ weeks without any fluid perfusion at higher levels than spheroids and macrogels, and such microtissues can be used to assess drug-mediated CYP induction and hepatotoxicity. Ultimately, microtissues may find broader utility for modeling liver diseases and as building blocks for cell-based therapies.
+ ]]></description>
+ <dc:creator><![CDATA[ Kukla, D., Crampton, A., Wood, D., Khetani, S. ]]></dc:creator>
+ <dc:date>2019-11-29</dc:date>
+ <dc:identifier>doi:10.1101/857789</dc:identifier>
+ <dc:title><![CDATA[Microscale Collagen and Fibroblast Interactions Enhance Primary Human Hepatocyte Functions in 3-Dimensional Models]]></dc:title>
+ <dc:publisher>Cold Spring Harbor Laboratory</dc:publisher>
+ <prism:publicationDate>2019-11-29</prism:publicationDate>
+ <prism:section></prism:section>
+ </item>
+ </rdf:RDF>`
+
+ feed, err := Parse(bytes.NewBufferString(data))
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ if feed.SiteURL != "http://biorxiv.org" {
+ t.Errorf(`Incorrect URL, got: %q`, feed.SiteURL)
+ }
+
+ if len(feed.Entries) != 1 {
+ t.Fatalf(`Unexpected number of entries, got %d`, len(feed.Entries))
+ }
+
+ if feed.Entries[0].URL != `http://biorxiv.org/cgi/content/short/857789v1?rss=1` {
+ t.Errorf(`Unexpected entry URL, got %q`, feed.Entries[0].URL)
+ }
+}
diff --git a/reader/rdf/rdf.go b/reader/rdf/rdf.go
index 6ee6828..7061883 100644
--- a/reader/rdf/rdf.go
+++ b/reader/rdf/rdf.go
@@ -63,7 +63,7 @@ func (r *rdfItem) Transform() *model.Entry {
entry := new(model.Entry)
entry.Title = strings.TrimSpace(r.Title)
entry.Author = strings.TrimSpace(r.Creator)
- entry.URL = r.Link
+ entry.URL = strings.TrimSpace(r.Link)
entry.Content = r.Description
entry.Hash = getHash(r)
entry.Date = getDate(r)