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.
- Host: GitHub
- URL: https://github.com/navid2zp/dbpreader
- Owner: Navid2zp
- License: mit
- Created: 2019-08-23T21:22:26.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-10T09:59:46.000Z (over 5 years ago)
- Last Synced: 2025-01-20T15:32:12.198Z (9 months ago)
- Topics: dbpedia, golang
- Language: Go
- Size: 11.7 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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