Skip to content

Commit 97597d2

Browse files
Merge pull request #658 from dice-group/develop
Changes on publication page
2 parents 62af8b6 + 3ed4e99 commit 97597d2

12 files changed

Lines changed: 262 additions & 115 deletions

File tree

data/bib/dice.bib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8913,7 +8913,7 @@ @inproceedings{bigerl2025tentriswcojupdate
89138913
@inproceedings{moteu2025benchmarkingke,
89148914
author = {Moteu, Ngoli Tatiana and Kouagou, N'Dah Jean and Zahera, Hamada M. and Ngonga Ngomo, Axel-Cyrille},
89158915
booktitle = {The Semantic Web -- ISWC 2025},
8916-
keywords = {dice sailproject kiowl moteu kouagou zahera ngonga},
8916+
keywords = {dice sailproject kiowl tatianam kouagou zahera ngonga},
89178917
title = {Benchmarking Knowledge Editing using Logical Rules},
89188918
url = {https://svn.dice-research.org/open/papers/2025/ISWC_Benchmarking-KE/public.pdf},
89198919
year = {2025},

scripts/papers-to-ttl/index.js

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function normalizeUrl(s) {
102102
return url;
103103
}
104104

105-
// Keep legacy behaivor for PDF URLs but reuse the generic normalizer.
105+
// Keep legacy behavior for PDF URLs but reuse the generic normalizer.
106106
function preprocessPdfUrl(url) {
107107
return normalizeUrl(url);
108108
}
@@ -185,11 +185,35 @@ const main = async () => {
185185
}
186186
}
187187

188+
if (paper.doi) {
189+
writeLiteral(
190+
'doi',
191+
String(paper.doi)
192+
.replace(/^https?:\/\/(dx\.)?doi\.org\//i, '')
193+
.trim()
194+
);
195+
}
196+
188197
writeUrl(`${prefixes.schema}bibsonomyId`, paper.id);
189198
var pdfUrl = preprocessPdfUrl(paper['bdsk-url-1'] || paper['1']);
190199
if (checkUrl(pdfUrl)) {
191200
writeUrl(`${prefixes.schema}pdfUrl`, pdfUrl);
192201
}
202+
203+
const presentationUrl = normalizeUrl(
204+
paper.presentation || paper.slides || paper.presentationurl
205+
);
206+
if (checkUrl(presentationUrl)) {
207+
writeUrl(`${prefixes.schema}presentationUrl`, presentationUrl);
208+
}
209+
210+
const videoUrl = normalizeUrl(
211+
paper.video || paper.recording || paper.videourl
212+
);
213+
if (checkUrl(videoUrl)) {
214+
writeUrl(`${prefixes.schema}videoUrl`, videoUrl);
215+
}
216+
193217
if (paper.authors && paper.authors.length > 0) {
194218
// write URLs that link to our website
195219
paper.authors.forEach(author => {
Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,31 @@
11
import React from 'react';
22
import { FaExternalLinkAlt, FaFilePdf } from 'react-icons/fa';
33

4-
export default function ExternalLink({ to, kind = 'link', children }) {
4+
export default function ExternalLink({
5+
to,
6+
kind = 'link',
7+
children,
8+
className = '',
9+
showIcon = true,
10+
...rest
11+
}) {
512
const Icon = kind === 'link' ? FaExternalLinkAlt : FaFilePdf;
13+
const isHttp = /^https?:\/\//i.test(String(to));
14+
const cls = ['external-link', className].filter(Boolean).join(' ');
15+
616
return (
7-
<a className="external-link" href={to}>
8-
{children} <Icon className="icon" />
17+
<a
18+
className={cls}
19+
href={to}
20+
{...(isHttp ? { target: '_blank', rel: 'noopener noreferrer' } : {})}
21+
{...rest}
22+
>
23+
{children}
24+
{showIcon && (
25+
<span className="title-icon" aria-hidden="true">
26+
<Icon className="title-icon__svg" />
27+
</span>
28+
)}
929
</a>
1030
);
1131
}
Lines changed: 65 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,81 @@
1-
import { graphql, useStaticQuery } from 'gatsby';
1+
import { graphql, StaticQuery } from 'gatsby';
22
import React from 'react';
33
import PapersFilter from './filter';
44
import Paper from './paper';
55

6-
const papersQuery = graphql`
7-
query {
8-
allRdf(
9-
filter: {
10-
data: {
11-
rdf_type: {
12-
elemMatch: {
13-
id: { eq: "https://schema.dice-research.org/Publication" }
6+
const PapersList = ({ name, publicationTag, path }) => (
7+
<StaticQuery
8+
query={graphql`
9+
query PersonPublications {
10+
allRdf(
11+
filter: {
12+
data: {
13+
rdf_type: {
14+
elemMatch: {
15+
id: { eq: "https://schema.dice-research.org/Publication" }
16+
}
17+
}
1418
}
1519
}
16-
}
17-
}
18-
) {
19-
edges {
20-
node {
21-
data {
22-
type
23-
title
24-
publicationType
25-
year
26-
source
27-
url
28-
tag
29-
bibsonomyId
30-
author {
20+
sort: { fields: [data___year], order: DESC }
21+
) {
22+
edges {
23+
node {
3124
id
32-
path
3325
data {
34-
name
26+
type
27+
title
28+
publicationType
29+
year
30+
source
31+
tag
32+
url
33+
pdfUrl
34+
doi
35+
presentationUrl
36+
videoUrl
37+
bibsonomyId
38+
author {
39+
id
40+
path
41+
}
42+
authorName
3543
}
3644
}
37-
authorName
3845
}
39-
id
4046
}
4147
}
42-
}
43-
}
44-
`;
48+
`}
49+
render={({ allRdf: { edges } }) => {
50+
const normName = (name || '').trim().toLowerCase();
4551

46-
export default ({ name, publicationTag, path }) => {
47-
const {
48-
allRdf: { edges: allPapers },
49-
} = useStaticQuery(papersQuery);
52+
const matches = edges.filter(({ node }) => {
53+
const d = node.data || {};
54+
const byPath = (d.author || []).some(a => a.path === path);
55+
const byExactName = (d.authorName || []).some(
56+
n => (n || '').toLowerCase() === normName
57+
);
58+
const byTag = publicationTag
59+
? (d.tag || []).includes(publicationTag)
60+
: false;
61+
return byPath || byExactName || byTag;
62+
});
5063

51-
const papers = allPapers.filter(
52-
({
53-
node: {
54-
data: { tag, authorName, author },
55-
},
56-
}) => {
57-
const hasTag =
58-
publicationTag &&
59-
tag &&
60-
tag.length > 0 &&
61-
tag.find(
62-
t =>
63-
t.localeCompare(publicationTag, 'en', { sensitivity: 'base' }) === 0
64-
) !== undefined;
65-
const hasAuthorByName =
66-
name &&
67-
authorName &&
68-
authorName.length > 0 &&
69-
authorName.find(
70-
n => n.localeCompare(name, 'en', { sensitivity: 'base' }) === 0
71-
) !== undefined;
72-
const hasAuthorByPath = author && author.find(a => a.path === path);
73-
return hasTag || hasAuthorByName || hasAuthorByPath;
74-
}
75-
);
64+
const uniqueEdges = Array.from(
65+
new Map(matches.map(e => [e.node.id, e])).values()
66+
);
7667

77-
return (
78-
<PapersFilter limit={5} edges={papers}>
79-
{papers =>
80-
papers.length === 0 ? (
81-
<div className="paper">
82-
<h3 className="paper-name">No papers found</h3>
83-
</div>
84-
) : (
85-
papers.map(({ node }) => <Paper key={node.id} data={node.data} />)
86-
)
87-
}
88-
</PapersFilter>
89-
);
90-
};
68+
if (uniqueEdges.length === 0) return <p>No publications yet.</p>;
69+
70+
return (
71+
<PapersFilter edges={uniqueEdges} limit={5}>
72+
{papers =>
73+
papers.map(({ node }) => <Paper key={node.id} data={node.data} />)
74+
}
75+
</PapersFilter>
76+
);
77+
}}
78+
/>
79+
);
80+
81+
export default PapersList;

scripts/src/components/papers/paper.js

Lines changed: 89 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@ import ExternalLink from '../externalLink';
33

44
const renderTitle = ({ title, url, pdfUrl }) => {
55
if (pdfUrl) {
6-
return <ExternalLink to={pdfUrl}>{title}</ExternalLink>;
6+
return (
7+
<ExternalLink to={pdfUrl} showIcon>
8+
{title}
9+
</ExternalLink>
10+
);
711
}
812
if (url) {
9-
return <ExternalLink to={url}>{title}</ExternalLink>;
13+
return (
14+
<ExternalLink to={url} showIcon>
15+
{title}
16+
</ExternalLink>
17+
);
1018
}
1119

1220
return title;
@@ -22,20 +30,85 @@ const Paper = ({
2230
url,
2331
pdfUrl,
2432
bibsonomyId,
33+
doi,
34+
presentationUrl,
35+
videoUrl,
2536
},
26-
}) => (
27-
<div className="paper">
28-
<p className="paper-text">
29-
{source}, {year}, #{publicationType}
30-
</p>
31-
<h3 className="paper-name">
32-
{renderTitle({ title, url, pdfUrl })}{' '}
33-
<a className="bib-link" href={bibsonomyId}>
34-
Get BibTex
35-
</a>
36-
</h3>
37-
<p className="paper-meta">By {(authorName || []).join(', ')}</p>
38-
</div>
39-
);
37+
}) => {
38+
const doiHref = doi
39+
? `https://doi.org/${String(doi)
40+
.replace(/^https?:\/\/(dx\.)?doi\.org\//i, '')
41+
.trim()}`
42+
: url && /doi\.org/i.test(url)
43+
? url
44+
: null;
45+
46+
const normalizeForCompare = href => {
47+
if (!href) return '';
48+
let s = String(href).trim();
49+
s = s.replace(/^https?:\/\/(dx\.)?doi\.org\//i, 'https://doi.org/');
50+
s = s.replace(/^https?:\/\//i, '').replace(/\/+$/, '');
51+
return s.toLowerCase();
52+
};
53+
const same = (a, b) => normalizeForCompare(a) === normalizeForCompare(b);
54+
const showDoiIcon = doiHref && !same(doiHref, url) && !same(doiHref, pdfUrl);
55+
56+
const IconLink = ({ href, label, src }) =>
57+
href ? (
58+
<ExternalLink
59+
to={href}
60+
className="paper-icon"
61+
aria-label={label}
62+
title={label}
63+
showIcon={false}
64+
>
65+
<img src={src} alt="" loading="lazy" decoding="async" />
66+
<span className="sr-only">{label}</span>
67+
</ExternalLink>
68+
) : null;
69+
70+
return (
71+
<div className="paper paper--light">
72+
<h3 className="paper-name">{renderTitle({ title, url, pdfUrl })}</h3>
73+
74+
<p className="paper-meta">By {(authorName || []).join(', ')}</p>
75+
76+
<p className="paper-text">
77+
{source}, {year}
78+
{publicationType ? `, #${publicationType}` : ''}
79+
</p>
80+
81+
<div className="paper-links">
82+
<IconLink
83+
href={pdfUrl}
84+
label="PDF"
85+
src="/images/publications/pdf.png"
86+
/>
87+
<IconLink
88+
href={bibsonomyId}
89+
label="BibTeX"
90+
src="/images/publications/bib.png"
91+
/>
92+
{showDoiIcon && (
93+
<IconLink
94+
href={doiHref}
95+
label="DOI"
96+
src="/images/publications/doi.png"
97+
/>
98+
)}
99+
<IconLink
100+
href={presentationUrl}
101+
label="Presentation"
102+
src="/images/publications/presentation.png"
103+
/>
104+
<IconLink
105+
href={videoUrl}
106+
label="Video"
107+
src="/images/publications/video.png"
108+
/>
109+
</div>
110+
</div>
111+
);
112+
};
40113

41114
export default Paper;

0 commit comments

Comments
 (0)