Generate bibliographic details according to format type from file properties

What I’m trying to do

In my research I am recording citations from books and journals in individual files along with my own comments. For each resource I have a master file which lists all the files where that resource is cited. I use tags and Dataview for that part. This is working fine.

TABLE WITHOUT ID file.link as "Citations"
FROM #Library/Author_2020_Title
SORT file.name ASC

For each resource I have created properties which correspond to bibliographic details used for citations (e.g. author, title, date, publisher, etc.).

I would like Dataview to display this bibliographic data in various orders according to various citation formats. To do this, a Dataview query would need to pull certain properties from the file and then write them in plain text according to a designated order. I would prefer this over a LIST or TABLE.

If I am successful I would simply need to record the bibliographic information once for a new resource in the file properties and then Dataview would write the citation for me according to the various formats I need them in (separate queries for separate formats).

Things I have tried

What I have so far is my bibliographic details as file properties:

---
Author: 
Author 2: 
Author 3: 
Author 4: 
Author 5: 
Title: 
Series: 
Print Year Published:
Digital Year Published:
Publisher: 
Editors: 
Translators: 
Edition: 
Volume Number: 
Library Call Number: 
ISBN 10: 
ISBN 13: 
URL: 
Database: 
Date Accessed: 
Format: 
---

My query looks like this:

LIST WITHOUT ID author, title, print-year-published
WHERE file = this.file 

It returns an error because it has multiple properties?

I can only get it to display a single property.
It will only display as a list or table but I need it to output as plain text like this:

“Author Name, Book Title, Year”

Of any use? (The text below is a full note and two queries.)

---
Author: Will William 
Author 2: Bill Billiam
Author 3: Dill Dilliam
Author 4: Phil Philliam
Author 5: Secret Author
Title: This is the Title of the Book
Series: 1
Print Year Published: 2024
Digital Year Published: 2023
Publisher: Bear
Editors: Joy Full
Translators: What Words
Edition: 2
Volume Number: 2
Library Call Number: 234
ISBN 10: 1234567891
ISBN 13: 123456789012
URL: https://forum.obsidian.md/t/generate-bibliographic-details-according-to-format-type-from-file-properties/87658
Database: None
Date Accessed: 2024-08-03
Format: ePub
---

## q1

```dataview
TABLE WITHOUT ID
join(list(
"" + author,
"" + author-2,
"" + author-3,
"" + author-4,
"" + title,
"" + Editors,
"**Printed: **" + print-year-published,
"**ePub: **" + digital-year-published,
"" + URL))
as "Book Details"
WHERE file.name = this.file.name
```

## q2 

```dataview
TABLE WITHOUT ID
list(
"" + author,
"" + author-2,
"" + author-3,
"" + author-4,
"" + title,
"" + Editors,
"**Printed: **" + print-year-published,
"**ePub: **" + digital-year-published,
"" + URL)
as "Book Details"
WHERE file.name = this.file.name
```

That’s brilliant!

I’m getting an error:

Dataview: Error: 
-- PARSING FAILED --------------------------------------------------

  6 | "" + print-year-published, 
  7 | "" + publisher, 
> 8 | WHERE file.name = this.file.name
    |      ^

Expected:

variable

Regarding WHERE, Is it possible to reference the file directly using an ALIAS?

1 Like

I figured out that I changed the code and wasn’t closing the parentheses. Thank you, friend.

I’m using this code and it’s working great.

```dataview 
TABLE WITHOUT ID 
join(list( 
"" + author1,
"" + title, 
"" + print-year-published, 
"" + publisher))
as "Citation Format"
FROM "Directly/to/File"
1 Like

Glad you got it working. Apologies for the delay in replying—I wasn’t online.

The following works referencing an alias, but don’t know if it meets your needs or not:

---
Author: Will William 
Author 2: Bill Billiam
Author 3: Dill Dilliam
Author 4: Phil Philliam
Author 5: Secret Author
Title: This is the Title of the Book
Series: 1
Print Year Published: 2024
Digital Year Published: 2023
Publisher: Bear
Editors: Joy Full
Translators: What Words
Edition: 2
Volume Number: 2
Library Call Number: 234
ISBN 10: 1234567891
ISBN 13: 123456789012
URL: https://forum.obsidian.md/t/generate-bibliographic-details-according-to-format-type-from-file-properties/87658
Database: None
Date Accessed: 2024-08-03
Format: ePub
Aliases:
  - (A Tale of Three Pities)
---

## q1

```dataview
TABLE WITHOUT ID
join(list(
"" + author,
"" + title,
"" + aliases,
"" + print-year-published))
as "Book"
WHERE contains(aliases, "A Tale of Three Pities")
```


## q2

```dataview
TABLE WITHOUT ID
join(list(
"" + author,
"" + title,
"" + print-year-published))
as "Book"
WHERE contains(aliases, "A Tale of Three Pities")
```

It does. Thank you! Works perfectly.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.