Brick for Java Applications

111 views
Skip to first unread message

Niraj Dwivedi

unread,
Jul 5, 2021, 12:24:53 AM7/5/21
to Brick User Forum (Unified Building Metadata Schema)
Hi,

I am new to Brick Schema & trying to integrate it to my Java based application. 

Are there any help of links which can lead me to standard tags available in Brick as well as defining Brick schema for already existing entity hierarchy.

We need to assign Brick Tags to different entities including BacNet device points. Currently I can find only Python based info. Looking for Java based files/details.

I will appreciate any help on above.

Thanks,
Niraj

Erik Paulson

unread,
Jul 6, 2021, 12:53:46 PM7/6/21
to Niraj Dwivedi, Brick User Forum (Unified Building Metadata Schema)
Hi Niraj - 

There's good news and bad news.

First, the good news:  you really don't need to use any Brick-specific libraries to use Brick. The 'py-brickschema' package is for the most part just a set of convenience functions that build on top of the Python RDFlib, which is the most-used Python RDF library. You can use Brick by only using RDFlib and be just fine - I typically only use RDFlib when I'm doing Brick work and not py-brickschema (sorry Gabe!) 

Similarly, in just taking a look at RDF4J, I think it has most of things you'd want to be able to use Brick from Java: https://rdf4j.org/ - you should be able to use RDF4J to load in the brick.ttl file into your application and create a new Brick graph for your site, using the classes and relationships defined in Brick.ttl. (Presumably you've already got the code for loading BACnet points and storing them/using them in your application) 

Now, the bad news: the things that py-brickschema does automatically for you are pretty handy, especially around getting the schema loading and reasoner settings right, so there's some "gruntwork" that you'll have to do yourself to use Java. Equally a bummer, I don't know of  any example code using Brick with RDF4J, so if you're both new to Brick and to RDF there are fewer references to get going. (Maybe some other folks on the mailing list have sample code for loading, changing, and saving a Brick model using RDF4J?)

-Erik






--
You received this message because you are subscribed to the Google Groups "Brick User Forum (Unified Building Metadata Schema)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brickschema...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brickschema/3c2d64ac-38d8-4ddf-9c4a-5c60b46809b7n%40googlegroups.com.

Gabe Fierro

unread,
Jul 6, 2021, 7:21:38 PM7/6/21
to brick...@googlegroups.com

Hi Niraj:

I would also recommend taking a look at  Apache Jena  (https://jena.apache.org/) which has Java-based APIs that provide reasoning and query capabilities that may be helpful to you as well.

I don't currently have cycles to work on such a library, but I've made a note of it in our long-term roadmap (link here), and I would definitely lend a hand in any development effort that the community wants to start.

Best,

Gabe

Reply all
Reply to author
Forward
0 new messages