An open API service indexing awesome lists of open source software.

https://github.com/navid2zp/dbpreader

Read dbpedia pages into golang type and structs. Simple and easy to use.
https://github.com/navid2zp/dbpreader

dbpedia golang

Last synced: 7 months ago
JSON representation

Read dbpedia pages into golang type and structs. Simple and easy to use.

Awesome Lists containing this project

README

          

# dbpreader
Read dbpedia pages into golang type and structs. Simple and easy to use.

### Install
```
go get -u github.com/Navid2zp/dbpreader
```

### Example

Page: `http://dbpedia.org/page/Go_(programming_language)`
```go
import (
"fmt"
"dbpreader"
)

func main() {
results, err := dbpreader.Query("Go_(programming_language)")
if err != nil {
panic(err)
}
fmt.Println(results)

fmt.Println("Exact Resource:")
resource := results.FindResource("Go_(programming_language)")
fmt.Println(resource)

fmt.Println("WikiData Item:")
fmt.Println(resource.GetWikiDataItem())
}
```

#### Methods:

There is some small useful methods that you can use.
I might add more along the way.

**_FindResource:_**

The json version of dbpedia returns a list of results
This method will find and return the exact resource

```go
resource := results.FindResource("Go_(programming_language)")
fmt.Println(resource)
```

**_GetWikiDataItem:_**

Finds the wikidata item url

```go
resource.GetWikiDataItem()
```

License
----

MIT